jellyfin-web/dashboard-ui/scripts/playlist.js

25 lines
360 B
JavaScript
Raw Normal View History

2013-04-10 10:11:23 -07:00
var Playlist = (function() {
2013-04-08 13:46:59 -07:00
2013-04-10 10:11:23 -07:00
var self = this;
2013-04-08 13:46:59 -07:00
2013-04-10 10:11:23 -07:00
self.queue = [];
2013-04-08 13:46:59 -07:00
2013-04-10 10:11:23 -07:00
self.add = function(item) {
2013-04-08 13:46:59 -07:00
2013-04-10 10:11:23 -07:00
queue.push(item);
};
2013-04-08 13:46:59 -07:00
2013-04-10 10:11:23 -07:00
self.remove = function (index) {
queue.splice(index, 1);
};
self.play = function (index) {
MediaPlayer.play(queue[index]);
queue.shift();
};
return self;
})();