Order Now AdSolution Sign Up | Login » Bits on the Run Sign Up | Login »

Forums

/

OnPlaylist Complete?

3 replies [Last post]

I have a play list with two video's in it. If I use the "onComplete" event I've found in the demo's it's triggered after the first video in the playlist. Does anyone have some example code or an idea of how I can get onComplete to trigger only once the playlist is finished.

Video1, -> Video2, -> TriggerOnComplete, -> Execute whatever I want it todo lol

yes

To see it in action and be able to view the code sued visit my web site
miran.net especially the Experimental section and my transparent 3D cube. There I have six players functional and workable for/on the 3D cube.

The secret is to use the following:

onComplete: function()
   {
      $jwplayer('id').stop().setup(options);
   }

I had this problem too as not all videos are of the same length, thus when one stopped it affected the others and since each instance(cube face) of the JWPlayer has an id I was able to use the onComplete like above.

Hope this answers your query

Willie, I don't think that's what Chris meant. I have the same question...

Solved it. If you have two items, you can use a variable finish:

var finish = false;

onComplete: function() {
          if(finish) {
            hidePlayer();
          } else {
            finish = true;
          }
        }

If you have more items, use a counter and ++ it until it's equal to the playlist length.