mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
respond to playstate commands play/pause/stop/seek/nexttrack
This commit is contained in:
parent
1bae9609f6
commit
673548b630
2 changed files with 21 additions and 1 deletions
|
@ -1048,6 +1048,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;
|
||||||
};
|
};
|
||||||
|
|
|
@ -791,7 +791,23 @@ 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.queuePlayNext();
|
||||||
|
}
|
||||||
|
else if (msg.Data.Command === 'PreviousTrack') {
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue