2011-12-15 54 views
1

您好,我有以下问题, 我录制视频使用RED5是这样的:RED5播放视频oflademo使用ActionScript

nc = new NetConnection(); 
nc.connect("rtmp://localhost/oflaDemo"); 
ns = new NetStream(nc); 
ns.attachCamera(cam); 
ns.attachAudio(mic); 
ns.publish("file1", "record"); 

和视频存储在 C:\ Program Files文件(x86)的\的Red5 \的webapps \ oflaDemo \流

而当我尝试播放同一视频我做的:

nc = new NetConnection(); 
nc.connect(null); 
ns = new NetStream(nc); 
ns.client = nsClient; 
video = new Video(myVid.width,myVid.height); 
video.attachNetStream(ns); 
video.smoothing=true; 
myVid.addChild(video); 
ns.play("http://localhost:5080/oflaDemo/file1.flv"); 

但它抛出错误#2044:未处理的NetStatusEv耳鼻喉科:。 level = error,code = NetStream.Play.StreamNotFound

任何想法???

回答

0

我解决了如何与播放视频的问题:

<s:VideoPlayer id="myVid" visible="true" width="100%" height="100%" mediaPlayerStateChange="myVid_mediaPlayerStateChangeHandler(event)"> 
<s:source> 
    <s:DynamicStreamingVideoSource host="{mediaServerUrl}" streamType="recorded"> 
     <s:DynamicStreamingVideoItem streamName="{videoFolder}/{filename}"/> 
    </s:DynamicStreamingVideoSource> 
</s:source> 
</s:VideoPlayer> 
1

请更改ns.play(“http:// localhost:5080/oflaDemo/file1.flv”);ns.play(“rtmp:// localhost:5080/oflaDemo/file1.flv”);希望它有用与您

+0

RTMP端口是不是5080默认情况下!它应该是1935年,所以:ns.play(“rtmp:// localhost:1935/oflaDemo/file1.flv”);或简单地ns.play(“rtmp://localhost/oflaDemo/file1.flv”); – steven 2012-12-01 20:29:57