Skip to main content
Known Participant
September 15, 2009
Question

streaming video, flash media server, SMIL files

  • September 15, 2009
  • 1 reply
  • 907 views

Hi,
I have a video player working just fine with one video, steaming and using dynamic stream switching on a flash media server.
Now I want to have more videos.
I want to start using SMIL files for the dynamic switching list for each video.
If you do not know what a SMIL file is you probably can not help.

Anyway how do I point to a SMIl file instead of just listing the streams.
here is how I do my list at the moment


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;

can I just say
var dsi:DynamicStreamItem = new DynamicStreamItem();
dsi.addStream(GeneralReel_512x375.SMIL);

I am not using the flash video component. The only info I could find about using a SMIL file was for the component and did not help.
thanks Mark

This topic has been closed for replies.

1 reply

Inspiring
September 15, 2009

According to documentation (http://www.adobe.com/devnet/flashmediaserver/articles/dynstream_advanced_pt2_02.html), addStream() method accepts only two parameters and adds asset url and bitRate to the array of streams. This means that it doesn't have a capability to parse SMIL which, essentially, is just XML. It is a good news because DynamicStreamItem must not depend on XML structure.

In other words, whether the XML is structured to SMIL specs or not should not be relevant. One reason is that people have preparatory CMS that consume XMLs of different structures or don't rely on XML at all - they should be able to use dynamic streaming independent of it.

mgasonAuthor
Known Participant
September 15, 2009

Hi,

thanks for the reply. I admit to being in way over my head, and quite astonished that I have this working at all.

I in fact used the articles you pointed to to build my player not using the flvplayback component.

I have a video object on stage, in the properties panel it shows as "Linked Video", instance video, with a little camcorder icon.

The only reference I could find in the adobe articles

http://www.adobe.com/devnet/flashmediaserver/articles/dynstream_advanced_pt1_05.html#walk03

refers to using the flvplayback component and just setting the smil by simply saying

flvpb.source = "dynamicStream.smil";

can I just remove the dsi.addstream stuff and set
video.source = "mySmilFile.smil";

If not how do I go about it?

here is what seems the relevant code from my fla as it is.
I am pretty sure this is everything which deals with
making a connection and playing the video.
I took out all the buttons and progress bar stuff.
I am using the ADOBE ACTIONSCRIPT 3.0 DYNAMIC STREAMING CLASS from

http://www.adobe.com/products/flashmediaserver/tool_downloads/

var _ds:DynamicStream;

var nc:NetConnection = new NetConnection();

nc.connect("rtmp://ss1.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 );

_ds.startBufferLength = 2;

_ds.preferredBufferLength = 5;

_ds.aggressiveModeBufferLength = 2;

_ds.switchQOSTimerDelay = 1;

playVideo();

}

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;

function playVideo():void{

     _ds.startPlay( dsi );

}