mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
finish #386 and implement nextTrack action
This commit is contained in:
parent
673548b630
commit
47a6b2c0ae
2 changed files with 19 additions and 3 deletions
|
@ -94,7 +94,7 @@
|
|||
|
||||
$(this).off('ended.playnext');
|
||||
|
||||
self.queuePlayNext();
|
||||
self.nextTrack();
|
||||
}
|
||||
|
||||
function startProgressInterval(itemId) {
|
||||
|
@ -991,7 +991,7 @@
|
|||
});
|
||||
};
|
||||
|
||||
self.queuePlayNext = function () {
|
||||
self.nextTrack = function () {
|
||||
|
||||
var newIndex = currentPlaylistIndex + 1;
|
||||
var newItem = self.playlist[newIndex];
|
||||
|
@ -1004,6 +1004,21 @@
|
|||
});
|
||||
}
|
||||
};
|
||||
|
||||
self.previousTrack = function () {
|
||||
var newIndex = currentPlaylistIndex - 1;
|
||||
if (newIndex >= 0) {
|
||||
var newItem = self.playlist[newIndex];
|
||||
|
||||
if (newItem) {
|
||||
Dashboard.getCurrentUser().done(function (user) {
|
||||
|
||||
self.playInternal(newItem, 0, user);
|
||||
currentPlaylistIndex = newIndex;
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
self.queueItem = function (item) {
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue