mirror of
https://github.com/captbaritone/webamp.git
synced 2026-07-22 09:37:17 +00:00
Progress on repeat now that we have playlists
This commit is contained in:
parent
ea060500cf
commit
8f78fd73c5
2 changed files with 11 additions and 8 deletions
13
js/media.js
13
js/media.js
|
|
@ -228,6 +228,10 @@ Media = {
|
|||
this.play(time);
|
||||
},
|
||||
|
||||
repeatEnabled: function() {
|
||||
return this._loop;
|
||||
},
|
||||
|
||||
// There is probably a more reasonable way to do this, rather than having
|
||||
// it always running.
|
||||
_draw: function() {
|
||||
|
|
@ -246,13 +250,8 @@ Media = {
|
|||
_updatePosition: function() {
|
||||
this._position = this._context.currentTime - this._startTime;
|
||||
if(this._position >= this._buffer.duration && this._playing) {
|
||||
// Idealy we could use _source.loop, but it makes updating the position tricky
|
||||
if(this._loop) {
|
||||
this.play(0);
|
||||
} else {
|
||||
this.stop();
|
||||
this._callbacks.ended();
|
||||
}
|
||||
this.stop();
|
||||
this._callbacks.ended();
|
||||
}
|
||||
return this._position;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -64,7 +64,11 @@ Winamp = {
|
|||
|
||||
this.media.addEventListener('ended', function() {
|
||||
self.skin.visualizer.clear();
|
||||
self.setState('stop');
|
||||
if(self.media.repeatEnabled()) {
|
||||
self.next();
|
||||
} else {
|
||||
self.setState('stop');
|
||||
}
|
||||
});
|
||||
|
||||
this.media.addEventListener('waiting', function() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue