Commit 3714d2a9 authored by Simon Daron's avatar Simon Daron
Browse files

Audioplayer fix bug in playing/active

parent ac36ac41
......@@ -308,7 +308,7 @@ body{
padding:0.5em;
text-align:center;
}
#Playlist .playing{
#Playlist .playing .icon-pause{
-webkit-animation: loading 1s infinite linear;
-moz-animation: loading 1s infinite linear;
-o-animation: loading 1s infinite linear;
......
......@@ -92,10 +92,9 @@
audio.attr('title',sound.title)
.attr('data-origin',sound.id)
.on('play',function(){
$(this).addClass('playing');
container.addClass('playing');
container.addClass('active');
playpause.addClass('icon-pause').removeClass('icon-play');
thePlaylist.playlistContainer.find('audio:not(.playing)').trigger('stop');
thePlaylist.playpause.removeClass('icon-play').addClass('icon-pause');
thePlaylist.afterPlay();
}).on('pause',function(){
......@@ -103,6 +102,7 @@
playpause.addClass('icon-play').removeClass('icon-pause');
thePlaylist.playpause.removeClass('icon-pause').addClass('icon-play');
}).on('stop',function(){
container.removeClass('active');
$(this).trigger('pause');
$(this)[0].currentTime = 0;
container.removeClass('active');
......@@ -111,6 +111,7 @@
}).on('beforePause',function(){
return this;
}).on('beforePlay',function(){
thePlaylist.playlistContainer.find('.active').removeClass('active');
thePlaylist.pauseSounds();
return this;
});
......
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