Skip to main content
Participant
April 7, 2011
Question

Client side playlist with dynamicaly streamed items possible?

  • April 7, 2011
  • 1 reply
  • 668 views

Hey,

is there a way to define a client side playlist like this:

ns.play(      "stream1",      0,      30              );

ns.play(      "stream2",      10,    -1, false      );

ns.play( "     stream3",      0,      -1, false      );

ns.play(      "stream4",      30,    120, false    );

but instead of a single videofiles for each playlistentry use dynamic streaming?

I know how the DynamicStream class is working and how to set it up but i can't find any information if it is possible to combined those two techniques.

Thanks for any suggestions.

    This topic has been closed for replies.

    1 reply

    Adobe Employee
    April 9, 2011

    Yes upto a certain extent you can achieve it, see below approach if it suits you. You can have playlist as xml file and each video tag will represent single item in playlist. So suppose you have xml file with video tags as below:

    <videoList vodurl="rtmp://localhost/myapp">
    <video>
                      <label>flv:stream</label>
                       <data>stream1,stream2,stream3</data>
                       <bitrate>100,200,350</bitrate>
    </video>

    <video>
                       <label>mp4:stream</label>
                        <data>mp4:stream1.mp4,mp4:stream2.mp4,mp4:stream3.mp4</data>
                        <bitrate>100,200,350</bitrate>
    </video>
    </videoList>

    Then you need to create dynamic stream item("dsi") as below for each video tag and create array of "dsi".

    var dsi:DynamicStreamItem = new DynamicStreamItem();

    dsi.addStream( "mp4:stream1.mp4", 100);

    dsi.addStream( "mp4:stream2.mp4", 200 );

    dsi.addStream( "mp4:stream3.mp4", 350 );

    ds.startPlay( dsi );

    Then iterate each item of array, while you are playing first item of array then based on netstatus messages like "NetStream.Play.Complete" you can decide to move on to next item in array. So in this way you can create client side playlist.

    Regards,

    Amit