red5使用actionscript播放视频oflademo

时间:2011-12-15 13:53:16

标签: actionscript record red5 playback

您好我有以下问题, 我使用red5录制视频,如下所示:

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 \ streams

当我尝试播放相同的视频时:

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:未处理的NetStatusEvent:。 level = error,code = NetStream.Play.StreamNotFound

任何想法???

2 个答案:

答案 0 :(得分:1)

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

答案 1 :(得分: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>