Change end-of-queue behavior to set currentMedia to null and position to -1

This commit is contained in:
calzoneman 2013-03-05 16:41:29 -06:00
parent 3e556a5c54
commit d7813d7f6c
1 changed files with 4 additions and 1 deletions

View File

@ -335,8 +335,11 @@ Channel.prototype.unqueue = function(data) {
// Play the next media in the queue // Play the next media in the queue
Channel.prototype.playNext = function() { Channel.prototype.playNext = function() {
if(this.currentPosition + 1 >= this.queue.length) if(this.currentPosition + 1 >= this.queue.length) {
this.currentMedia = null;
this.currentPosition = -1;
return; return;
}
this.currentPosition++; this.currentPosition++;
this.currentMedia = this.queue[this.currentPosition]; this.currentMedia = this.queue[this.currentPosition];
this.currentMedia.currentTime = 0; this.currentMedia.currentTime = 0;