jplayer / jPlayer

jPlayer : HTML5 Audio & Video for jQuery
http://jplayer.org/
Other
4.6k stars 1.47k forks source link

Click on previous button does not loop in playlist #312

Closed alphazyx closed 9 years ago

alphazyx commented 9 years ago

when the current index is 0, click event on the previous button does not make the current index to the last item of the playlist. May be the code in line 456 of dist/addon/jplayer.playlist.js should be changed from if(this.loop && this.options.playlistOptions.loopOnPrevious || index < this.playlist.length - 1) { to if(this.loop && this.options.playlistOptions.loopOnPrevious || index < this.playlist.length) {

thepag commented 9 years ago

The clue was in the code... The loopOnPrevious option. Your hack would only break it.

The docs: http://jplayer.org/latest/demo-02-jPlayerPlaylist/

loopOnPrevious : Boolean : If loop is active, the playlist will loop back to the end when executing previous().