blob: c0d26a1c5c331b073232b7fab48761cbe3d002f5 [file] [log] [blame]
<library>
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
<!---
This class provides the basic functions for the video-output
@START_CODE
<baseVideoView x="20" y="20" width="320" height="240" bgcolor="black" />
@END_CODE
-->
<class name="baseVideoView" width="${parent.width}" height="${parent.height}">
<passthrough when="$as3">
import flash.media.*;
import flash.net.NetConnection;
import flash.net.NetStream;
</passthrough>
<attribute name="_sound" value="null"/>
<method name="init"><![CDATA[
super.init();
var mc = new Video(this.width, this.height);
this.sprite.addChild(mc);
this.__LZvideo = mc;
this.applySizeToVid();
]]></method>
<method name="applySizeToVid">
var vid = this._getflashvideo();
if(vid != null) {
vid.width = this.width;
vid.height = this.height;
} else {
if ($debug) Debug.warn("applySizeToVid IS NULL ",this.width,this.height);
}
</method>
<handler name="onwidth" args="w">
//if ($debug) Debug.info("onwidth ",this.width,this.height);
this.applySizeToVid();
</handler>
<handler name="onheight" args="h">
//if ($debug) Debug.info("onheight ",this.width,this.height);
this.applySizeToVid();
</handler>
<method name="_getflashvideo">
<![CDATA[
//Debug.write("_getflashvideo()");
return this.__LZvideo;
]]>
</method>
<method name="attachCamera" args="camera">
var vid = this._getflashvideo();
vid.attachCamera(camera);
</method>
<!--- shows the Video (NetStream) in the View -->
<method name="attachVideo" args="video">
var vid = this._getflashvideo();
vid.attachNetStream(video);
</method>
<method name="clear">
var vid = this._getflashvideo();
vid.attachNetStream(null);
this.__LZvideo.clear();
</method>
</class>
</library>