2016-10-13 00:16:48 点击量:13 标签: 收藏本文
定义要缩放的矩形,然后设置 Stage.displayState 属性。有关详细信息,请参阅用于 Adobe Flash Platform 的 ActionScript 3.0 参考。完整的示例(如下所示)添加了额外的代码,这些代码创建连接以及视频的 NetStream 对象,并开始播放该视频。
- package
- {
- import flash.net.NetConnection;
- import flash.net.NetStream;
- import flash.media.Video;
- import flash.display.StageDisplayState;
- import fl.controls.Button;
- import flash.display.Sprite;
- import flash.events.MouseEvent;
- import flash.events.FullScreenEvent;
- import flash.geom.Rectangle;
- public class FullScreenVideoExample extends Sprite
- {
- var fullScreenButton:Button = new Button();
- var video:Video = new Video();
- public function FullScreenVideoExample()
- {
- var videoConnection:NetConnection = new NetConnection();
- videoConnection.connect(null);
- var videoStream:NetStream = new NetStream(videoConnection);
- videoStream.client = this;
- addChild(video);
- video.attachNetStream(videoStream);
- videoStream.play("http://www.helpexamples.com/flash/video/water.flv");
- fullScreenButton.x = 100;
- fullScreenButton.y = 270;
- fullScreenButton.label = "Full Screen";
- addChild(fullScreenButton);
- fullScreenButton.addEventListener(MouseEvent.CLICK, fullScreenButtonHandler);
- }
- private function fullScreenButtonHandler(event:MouseEvent)
- {
- var screenRectangle:Rectangle = new Rectangle(video.x, video.y, video.width, video.height);
- stage.fullScreenSourceRect = screenRectangle;
- stage.displayState = StageDisplayState.FULL_SCREEN;
- }
- public function onMetaData(infoObject:Object):void
- {
- // stub for callback function
- }
- }
- }
我们是一家提供综合软件外包与弱电工程服务的技术公司。
业务涵盖定制软件、管理系统、网站、小程序、APP、系统集成、网络布线、监控安防、门禁、机房建设及长期技术维护。
公司地址:湖北省宜昌市伍家岗区东站二路6号三峡(宜昌)大数据产业园海洋馆二楼A203室