Commit b766c657 authored by Simon Daron's avatar Simon Daron
Browse files

Play first in playlist /bind playlist control to active sound

parent 84328e0a
......@@ -87,18 +87,20 @@
$(this).addClass('playing');
container.addClass('active');
playpause.addClass('icon-pause').removeClass('icon-play');
thePlaylist.playpause.addClass('icon-pause').removeClass('icon-play');
thePlaylist.playlistContainer.find('audio:not(.playing)').trigger('stop');
thePlaylist.playpause.removeClass('icon-play').addClass('icon-pause');
}).on('pause',function(){
$(this).removeClass('playing');
playpause.addClass('icon-play').removeClass('icon-pause');
thePlaylist.playpause.addClass('icon-play').removeClass('icon-pause');
thePlaylist.playpause.removeClass('icon-pause').addClass('icon-play');
}).on('stop',function(){
$(this).trigger('pause');
$(this)[0].currentTime = 0;
container.removeClass('active');
}).on("ended", function(){
thePlaylist.playNext();
}).on('beforePause',function(){
return this;
}).on('beforePlay',function(){
thePlaylist.stopSounds();
return this;
......@@ -160,11 +162,11 @@
},
// Play next sound
playPauseList: function() {
if(this.playpause.hasClass('.icon-play')){
if(this.playpause.hasClass('icon-play')){
if(this.playlistContainer.find('.active')[0]){
this.playlistContainer.find('.active').find('audio').trigger('beforePlay').trigger('play');
}else{
this.playlistContainer.first('li').trigger('beforePlay').trigger('play');
this.playlistContainer.children('li').first().find('audio').trigger('beforePlay').trigger('play');
}
}else{
this.playlistContainer.find('.active').find('audio').trigger('pause');
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment