[Flex]Flex和Red5制作视频直播播放器(2)
客户端使用Flex play视频代码如下: ? xml version = 1.0 encoding = utf-8 ? mx:Application xmlns:mx = http://www.adobe.com/2006/mxml layout = absolute applicationComplete = init() mx:Script !--[CDATA[ i
客户端使用Flex play视频代码如下:
- <?xml version="1.0" encoding="utf-8"?>
- <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" applicationComplete="init()">
- <mx:Script>
- <!--[CDATA[
- import flash.display.*;
- import flash.utils.*;
- import flash.events.*;
- import flash.net.*;
- import flash.media.Video;
- import flash.media.Camera;
- private var nc:NetConnection;
- private function init():void{
- nc = new NetConnection();
- nc.connect("rtmp://58.116.56.68:1935/Flex01");
- nc.addEventListener(NetStatusEvent.NET_STATUS,connectHandler);
- }
- private function connectHandler(evt:NetStatusEvent):void{
- var ns:NetStream = new NetStream(nc);
- var video:Video=new Video() ;
- video.width = 313;
- video.height = 194;
- video.attachNetStream(ns);
- ns.play("red5");
- videoDisplay.addChild(video);
- }
- ]]-->
- </mx:Script>
- <mx:Panel x="132" y="78" width="356" height="266" layout="absolute" title="现场直播" fontSize="14">
- <mx:VideoDisplay x="10" y="10" width="320" height="193" id="videoDisplay"/>
- </mx:Panel>
- </mx:Application>
热门文章推荐
- [HLS]做自己的m3u8点播系统使用HTTP Live Streaming(HLS技术)
- [FMS]FMS流媒体服务器配置与使用相关的介绍
- [AS3]什么是M3U8,与HTML5的区别是什么
- AS2.0 让flash自适应全屏,并且不自动缩放
- [AS3]as3.0的sound类常用技巧整理
- [AS3]as3与ByteArray详解、ByteArray介绍、ByteArray用法
- 关于RTMP,RTMPT,RTMPS,RTMPE,RTMPTE协议的介绍
- [JS]分享浏览器弹出窗口不被拦截JS示例
请稍候...