Skip to main content
Participant
Oct 1, 2009 7:39 AM UTC
Question

How to loop a server-side playlist

Hello,

i have a problem with my server-side playlist. I have three incoming live-streams from the FME:

/*

clientStream = Stream.get("New_Stream");

clientStream.play("live1", -1, 10, false);

clientStream.play("live2", -1, 10, false);

clientStream.play("live3", -1, 10, false);

*/

I want that every stream is changed every 10 seconds and that the complete playlist starts again after

the last stream was played.

So far it works but only for three times. Then the messages "NetStream.Play.Stop" occurs.

Thanks a lot for any solutions.

    This topic is closed to new replies. Start a new post to keep the conversation going.

    1 reply

    Adobe Employee
    Jun 21, 2010 6:18 AM UTC

    var clientStream;
    var id1, id2;

    application.onConnect = function(client)
    {
    trace("Client Connected...");
    this.acceptConnection(client);

    clientStream = Stream.get("New_Stream");
    clientStream.setBufferTime(10);

    clientStream.play("live1", -1, 10, false);

    id1 = setInterval(p1, 10000);
    }

    function p1(){
    clearInterval(id1);
    clientStream.play("live2", -1, 10, false);
    id2 = setInterval(p2, 10000);
    }

    function p2(){
    clearInterval(id2);
    clientStream.play("live3", -1, 10, false);
    id1 = setInterval(p1, 10000);
    }

    Regards,

    Amit

    Translate