From d7813d7f6cf4cd8373ce7660dd4c5da1149ecdea Mon Sep 17 00:00:00 2001 From: calzoneman Date: Tue, 5 Mar 2013 16:41:29 -0600 Subject: [PATCH] Change end-of-queue behavior to set currentMedia to null and position to -1 --- channel.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/channel.js b/channel.js index b82123b6..0f6f6f00 100644 --- a/channel.js +++ b/channel.js @@ -335,8 +335,11 @@ Channel.prototype.unqueue = function(data) { // Play the next media in the queue 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; + } this.currentPosition++; this.currentMedia = this.queue[this.currentPosition]; this.currentMedia.currentTime = 0;