mediafront / osmplayer

The Open Standard Media Player is an all-in-one media player for the web. It is an industry changing, open source (MIT) media player that is built to dynamically deliver any type of web media, including HTML5, YouTube, Vimeo, and Flash.
http://www.mediafront.org
MIT License
342 stars 181 forks source link

Single Video Loop #44

Closed DArmbrister closed 11 years ago

DArmbrister commented 11 years ago

I can't find any looping functionality in the documentation. I am trying to implement a single video loop for a playlist. Ideally the video would loop until the user selected another video in the playlist.

If there is no looping capability, any suggestions on where to start on building one myself would be greatly appreciated.

Thanks in advance, -David

travist commented 11 years ago

Currently, the way that looping occurs is if you are in a playlist, and there are more items to be played in the playlist, it will play through them, and then loop at the end. It sounds to me like you want it to loop over a single media within the playlist. If this is what you want, it will require some custom code, but it will probably look something like this...

I haven't tested this, but it should work in theory...

minplayer.get('playlist', function(playlist) {
  minplayer.get('player', function(player) {
    player.ubind(playlist.uuid + ':player_ended', function() {
      playlist.loadItem(playlist.currentItem);
    });
  });
});
DArmbrister commented 11 years ago

Thank you for the help.