2016-10-13 00:16:48 点击量:15 标签: 收藏本文
在应用程序初始化过程中设置 StageVideoAvailabilityEvent 和 VideoEvent 侦听器。例如,可以在 flash.events.Event.ADDED_TO_STAGE 事件处理函数中初始化这些侦听器。此事件可保证您的应用程序在舞台上可见;
- public class SimpleStageVideo extends Sprite
- private var nc:NetConnection;
- private var ns:NetStream;
- public function SimpleStageVideo()
- {
- // Constructor for SimpleStageVideo class
- // Make sure the app is visible and stage available
- addEventListener(Event.ADDED_TO_STAGE, onAddedToStage);
- }
- private function onAddedToStage(event:Event):void
- {
- //...
- // Connections
- nc = new NetConnection();
- nc.connect(null);
- ns = new NetStream(nc);
- ns.addEventListener(NetStatusEvent.NET_STATUS, onNetStatus);
- ns.client = this;
- // Screen
- video = new Video();
- video.smoothing = true;
- // Video Events
- // the StageVideoEvent.STAGE_VIDEO_STATE informs you whether
- // StageVideo is available
- stage.addEventListener(StageVideoAvailabilityEvent.STAGE_VIDEO_AVAILABILITY,
- onStageVideoState);
- // in case of fallback to Video, listen to the VideoEvent.RENDER_STATE
- // event to handle resize properly and know about the acceleration mode running
- video.addEventListener(VideoEvent.RENDER_STATE, videoStateChange);
- //...
- }
我们是一家提供综合软件外包与弱电工程服务的技术公司。
业务涵盖定制软件、管理系统、网站、小程序、APP、系统集成、网络布线、监控安防、门禁、机房建设及长期技术维护。
公司地址:湖北省宜昌市伍家岗区东站二路6号三峡(宜昌)大数据产业园海洋馆二楼A203室