1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00

Merge branch 'f386'

This commit is contained in:
Luis Miguel Almánzar 2013-07-18 23:13:25 -04:00
commit 56a319e265
2 changed files with 39 additions and 3 deletions

View file

@ -98,7 +98,7 @@
$(this).off('ended.playnext'); $(this).off('ended.playnext');
self.queuePlayNext(); self.nextTrack();
} }
function startProgressInterval(itemId) { function startProgressInterval(itemId) {
@ -991,7 +991,7 @@
}); });
}; };
self.queuePlayNext = function () { self.nextTrack = function () {
var newIndex = currentPlaylistIndex + 1; var newIndex = currentPlaylistIndex + 1;
var newItem = self.playlist[newIndex]; var newItem = self.playlist[newIndex];
@ -1005,6 +1005,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) { self.queueItem = function (item) {
self.playlist.push(item); self.playlist.push(item);
@ -1048,6 +1063,10 @@
currentMediaElement.play(); currentMediaElement.play();
}; };
self.seek = function (position) {
currentMediaElement.currentTime = position / (1000 * 10000);
};
self.mute = function () { self.mute = function () {
currentMediaElement.volume = 0; currentMediaElement.volume = 0;
}; };

View file

@ -791,7 +791,24 @@ var Dashboard = {
} }
else if (msg.MessageType === "Playstate") { else if (msg.MessageType === "Playstate") {
if (msg.Data.Command === 'Stop') {
MediaPlayer.stop();
}
else if (msg.Data.Command === 'Pause') {
MediaPlayer.pause();
}
else if (msg.Data.Command === 'Unpause') {
MediaPlayer.unpause();
}
else if (msg.Data.Command === 'Seek') {
MediaPlayer.seek(msg.Data.SeekPosition);
}
else if (msg.Data.Command === 'NextTrack') {
MediaPlayer.nextTrack();
}
else if (msg.Data.Command === 'PreviousTrack') {
MediaPlayer.previousTrack();
}
} }
}, },