Skip to main content
Known Participant
Jan 10, 2013 12:00 PM UTC
Answered

How to repeat a serverside playlist after last video without reload application

Hello!

This is my server side playlist application:

application.onAppStart = function(){

  this.myStream = Stream.get("serverplaylist");

  this.myStream.record();    

  this.myStream.play("two-01-02",0,-1,true );

  this.myStream.play("two-01-02", 0, -1, false);

  this.myStream.play("two-01-01",0,-1,false );

}

After last movie plays, I need to reload the application and it starts again.

I would like to ask, how to repeat the server side playlist, without reload the application. A real continuos play.

Thanks,
Rafael    

This topic is closed to new replies. Start a new post to keep the conversation going.
SE_0208Correct answer
Participating Frequently
Jan 11, 2013 6:48 AM UTC

Change your above code based on below lines (below is my code - showing how to repeat playlist, dont use my code directly - modify your code accordingly)

application.onAppStart = function(){

          ms = Stream.get("playlist");

          ms.onStatus = function(info){

                    trace("Ns status:"+info.code);

                    if(info.code == "NetStream.Play.Stop"){

                              trace("came here");

                              ms.play("sample",0,-1,false);

                              ms.play("mp4:sample1_150kbps.f4v",0,-1,false);

 

                    }

          }

          ms.play("sample",0,-1,true);

          ms.play("mp4:sample1_150kbps.f4v",0,-1,false);

}

1 reply

SE_0208Correct answer
Participating Frequently
Jan 11, 2013 6:48 AM UTC

Change your above code based on below lines (below is my code - showing how to repeat playlist, dont use my code directly - modify your code accordingly)

application.onAppStart = function(){

          ms = Stream.get("playlist");

          ms.onStatus = function(info){

                    trace("Ns status:"+info.code);

                    if(info.code == "NetStream.Play.Stop"){

                              trace("came here");

                              ms.play("sample",0,-1,false);

                              ms.play("mp4:sample1_150kbps.f4v",0,-1,false);

 

                    }

          }

          ms.play("sample",0,-1,true);

          ms.play("mp4:sample1_150kbps.f4v",0,-1,false);

}

Translate