Skip to content

Commit

Permalink
user can stop is now an option for when user clicks next and we are o…
Browse files Browse the repository at this point in the history
…n the last song.
  • Loading branch information
Dan Kantor committed Dec 4, 2012
1 parent 16d7e1f commit 5abdc73
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion index.js
Expand Up @@ -25,6 +25,10 @@ function PlayQueue(opts){
// doesn't skip through all songs
this.autoNext = true;

// if we are on the last song, user can click next
// and it will skip and fire stop events
this.userCanStop = false;

// Number of milliseconds we should wait before deciding the current
// song loading is not going to load and we should call next
this.load_timeout = 15000;
Expand Down Expand Up @@ -631,6 +635,11 @@ PlayQueue.prototype.next = function(e){
if(this.queueNumber < this.getList().length - 1){
this._goNext();
}
else{
if(this.userCanStop === true){
this.stop();
}
}
}
}

Expand Down Expand Up @@ -686,7 +695,6 @@ PlayQueue.prototype.previous = function(){
// Reset queueNumber
PlayQueue.prototype.stop = function(){
this.isStopped = true;
this.queueNumber = 0;
this.dispatchEvent('stop',
{
'audio': this.getAudioProperties()
Expand Down

0 comments on commit 5abdc73

Please sign in to comment.