Hi,
I am doing dynamic streaming using a flash media server.
Currently everything works fine with one video.
I now want to have different videos load when buttons are clicked.
I want to put the file list for each video in its own SMIL file.
How do I then have the SMIL file load and play the video when a button is clicked.
Currently I just have this right in my code for the one video, I have trimmed the code down to the basicsthanksPHP Code:
var _ds:DynamicStream;
var videoToPlay:String;
var nc:NetConnection = new NetConnection();
nc.connect("rtmp://myServer");
nc.addEventListener(NetStatusEvent.NET_STATUS, onStatus);
function createNetstream (){
_ds = new DynamicStream( nc );
_ds.addEventListener( NetStatusEvent.NET_STATUS, onStatus );
_ds.client = this;
video.attachNetStream( _ds );
playVideo();
}
function playVideo():void
{
_ds.startPlay( dsi );
}
function onStatus(e:Object):void
{
trace(e.info.code);
if(e.info.code == "NetConnection.Connect.Success")
{
createNetstream();
}
var dsi:DynamicStreamItem = new DynamicStreamItem();
dsi.addStream( "mp4:GeneralReel_512x375_BR300_CBR_A96_Prog_1KFPS.f4v", 300 );
dsi.addStream( "mp4:GeneralReel_512x375_BR600_CBR_A96_Prog_1KFPS.f4v", 600 );
dsi.addStream( "mp4:GeneralReel_512x375_BR1000_CBR_A96_Prog_1KFPS.f4v", 1000 );
dsi.addStream( "mp4:GeneralReel_512x375_BR1500_CBR_A96_Prog_1KFPS.f4v", 1500 );
dsi.startRate = 300;
Mark


Reply With Quote