2011-12-15 84 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