mirror of
https://github.com/jellyfin/jellyfin-web.git
synced 2024-11-18 03:18:19 -07:00
finish #386 and implement nextTrack action
This commit is contained in:
parent
673548b630
commit
47a6b2c0ae
@ -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) {
|
||||
|
||||
|
@ -804,9 +804,10 @@ var Dashboard = {
|
||||
MediaPlayer.seek(msg.Data.SeekPosition);
|
||||
}
|
||||
else if (msg.Data.Command === 'NextTrack') {
|
||||
MediaPlayer.queuePlayNext();
|
||||
MediaPlayer.nextTrack();
|
||||
}
|
||||
else if (msg.Data.Command === 'PreviousTrack') {
|
||||
MediaPlayer.previousTrack();
|
||||
}
|
||||
}
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user