Skip to main content
April 15, 2009
Question

DynamicStreamItem: Passing Dynamic Streaming Paths

  • April 15, 2009
  • 1 reply
  • 1657 views

I am using the new Dynamic Streaming classes with AS3 and FMS 3.5.  I am storing four different streams in different locations on FMS.  Because I can only identify one URI, how can I pass the different paths for each of the F4Vs?

Example in brief:

...

private var _nc:NetConnection;
private var _ds:DynamicStream;
private var _vidDisp:Video;
private var _connClient:ConnectionClient;

private var _uri:String = "rtmp://myserver.com/vod";
private var streamName:String = "MyString";

...

var dsi:DynamicStreamItem = new DynamicStreamItem();
_ds = new DynamicStream( _nc );

_ds.client = _connClient;

_vidDisp.attachNetStream( _ds ); //Video

dsi.addStream( "mp4:" + streamName + "_150.f4v", 150 );

dsi.addStream( "mp4:" + streamName + "_300.f4v", 300);
dsi.addStream( "mp4:" + streamName + "_500.f4v", 500 );

dsi.addStream( "mp4:" + streamName + "_1500.f4v", 1500 );

_ds.startPlay( dsi );

What I would like to do is the following:

...

private var _nc:NetConnection;
private var _ds:DynamicStream;
private var _vidDisp:Video;
private var _connClient:ConnectionClient;

private var _uri:String = "rtmp://myserver.com/vod";
private var streamName:String = "MyString";

...

var dsi:DynamicStreamItem = new DynamicStreamItem();
_ds = new DynamicStream( _nc );

_ds.client = _connClient;

_vidDisp.attachNetStream( _ds ); //Video

dsi.addStream( "directory_150/mp4:" + streamName + ".f4v", 150 );

dsi.addStream( "directory_300/mp4:" + streamName + ".f4v", 300);
dsi.addStream( "directory_500/mp4:" + streamName + ".f4v", 500 );

dsi.addStream( "directory_1500/mp4:" + streamName + ".f4v", 1500 );

_ds.startPlay( dsi );

The only other way I can think of to accomplish this is to make the URI based on the QOS info but I'd rather not go down that road.  Any help would be appreciated!

    This topic has been closed for replies.

    1 reply

    April 20, 2009

    You can do it almost exactly as you want to:

    dsi.addStream( "directory_150/mp4:" + streamName + ".f4v", 150 );

    dsi.addStream( "directory_300/mp4:" + streamName + ".f4v", 300);
    dsi.addStream( "directory_500/mp4:" + streamName + ".f4v", 500 );

    dsi.addStream( "directory_1500/mp4:" + streamName + ".f4v", 1500 );

    BUT, "mp4:" goes at the beginning of the stream path, like this:

    dsi.addStream( "mp4:directory_150/" + streamName + ".f4v", 150 );

    dsi.addStream( "mp4:directory_300/" + streamName + ".f4v", 300);
    dsi.addStream( "mp4:directory_500/" + streamName + ".f4v", 500 );

    dsi.addStream( "mp4:directory_1500/" + streamName + ".f4v", 1500 );

    HTH,

    JOdy

    April 24, 2009

    Thank you!  I thought I had tested this several times before but it's working now!  Thank you again!