1
0
Fork 0
mirror of https://github.com/Yetangitu/ampache synced 2025-10-05 19:41:55 +02:00

First draft for "Play Next" feature

This commit is contained in:
Tan Chee Eng 2014-12-30 17:22:59 +08:00
parent cb9062c004
commit 7c5ec76f51
11 changed files with 88 additions and 3 deletions

View file

@ -187,5 +187,24 @@ jPlayerPlaylist.prototype._highlight = function(index) {
}
};
jPlayerPlaylist.prototype.addAfter = function(media, idx) {
if (idx >= this.original.length || idx < 0) {
console.log("jPlayerPlaylist.addAfter: ERROR, Index out of bounds");
return;
}
$(this.cssSelector.playlist + " ul")
.find("li[name=" + idx + "]").after(this._createListItem(media)).end()
.find("li:last-child").hide().slideDown(this.options.playlistOptions.addTime);
this._updateControls();
this.original.splice(idx + 1, 0, media);
this.playlist.splice(idx + 1, 0, media);
if(this.original.length === 1) {
this.select(0);
}
};
$(document).ready(function() {
});