Hi Friends,
In my application i want to play a pre-recorded flv which is stored in C:\Program Files\Adobe\Flash Media Server 3\applications\MyVideoApp in a VideoDisplay Component. I’m getting all sorts of runtime errors and not able to play.
Please help…
Note: I’m not keeping any main.asc on the server coz I have kept value of autoBandWidthDetection=“false”. I was not able to understand main.asc’s component so i took this route
<mx:VideoDisplay x="27" y="36" width="269" height="194" id="Play_video" autoBandWidthDetection="false"/>
<mx:Script>
<![CDATA[
import flash.net.NetStream;
import flash.net.NetConnection;
import flash.events.NetStatusEvent;
public function init() : void
{
var netConn:NetConnection = new NetConnection();
//netConn.connect("rtmp://URLOfMyServer/MyVideoApp/my_recorded_stream.flv");
netConn.connect("rtmp://192.168.0.105/VideoStream/my_recorded_stream.flv");
netConn.addEventListener(NetStatusEvent.NET_STATUS , netStatus);
}
public function netStatus(event:NetStatusEvent) : void
{
var info:Object = event.info;
trace(info.code);
switch(info.code)
{
case "NetConnection.Connect.Success":
var nc:NetConnection = NetConnection(event.target);
var stream:NetStream = new NetStream(nc);
//stream.play("my_recorded_stream.flv");
Play_video.source = nc.uri;
//stream.client = Play_video;
Play_video.play();
break;
case "NetConnection.Connect.Closed":
break;
}
}
]]>
</mx:Script>