mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
updated web client to respond to new remote control commands
This commit is contained in:
parent
ce67f87714
commit
c1819ff31f
2 changed files with 74 additions and 6 deletions
|
@ -1180,11 +1180,37 @@
|
|||
};
|
||||
|
||||
self.mute = function () {
|
||||
|
||||
if (currentMediaElement) {
|
||||
currentMediaElement.volume = 0;
|
||||
}
|
||||
};
|
||||
|
||||
self.unmute = function () {
|
||||
if (currentMediaElement) {
|
||||
currentMediaElement.volume = volumeSlider.val();
|
||||
}
|
||||
};
|
||||
|
||||
self.toggleMute = function () {
|
||||
|
||||
if (currentMediaElement) {
|
||||
currentMediaElement.volume = currentMediaElement.volume ? 0 : volumeSlider.val();
|
||||
}
|
||||
};
|
||||
|
||||
self.volumeUp = function () {
|
||||
|
||||
if (currentMediaElement) {
|
||||
currentMediaElement.volume = Math.max(currentMediaElement.volume - 5, 0);
|
||||
}
|
||||
};
|
||||
|
||||
self.volumeDown = function () {
|
||||
|
||||
if (currentMediaElement) {
|
||||
currentMediaElement.volume = Math.min(currentMediaElement.volume + 5, 100);
|
||||
}
|
||||
};
|
||||
|
||||
self.stop = function () {
|
||||
|
|
|
@ -74,7 +74,7 @@ var Dashboard = {
|
|||
header.remove();
|
||||
|
||||
if (Dashboard.getUserPromise) {
|
||||
Dashboard.getUserPromise.done(function(user) {
|
||||
Dashboard.getUserPromise.done(function (user) {
|
||||
Dashboard.ensureHeader(page, user);
|
||||
});
|
||||
} else {
|
||||
|
@ -812,6 +812,48 @@ var Dashboard = {
|
|||
MediaPlayer.previousTrack();
|
||||
}
|
||||
}
|
||||
else if (msg.MessageType === "SystemCommand") {
|
||||
|
||||
if (msg.Data === 'GoHome') {
|
||||
Dashboard.navigate('index.html');
|
||||
}
|
||||
else if (msg.Data === 'GoToSettings') {
|
||||
Dashboard.navigate('dashboard.html');
|
||||
}
|
||||
else if (msg.Data === 'Mute') {
|
||||
MediaPlayer.mute();
|
||||
}
|
||||
else if (msg.Data === 'Unmute') {
|
||||
MediaPlayer.unmute();
|
||||
}
|
||||
else if (msg.Data === 'VolumeUp') {
|
||||
MediaPlayer.volumeUp();
|
||||
}
|
||||
else if (msg.Data === 'VolumeDown') {
|
||||
MediaPlayer.volumeDown();
|
||||
}
|
||||
else if (msg.Data === 'ToggleMute') {
|
||||
MediaPlayer.toggleMute();
|
||||
}
|
||||
}
|
||||
else if (msg.MessageType === "MessageCommand") {
|
||||
|
||||
var cmd = msg.Data;
|
||||
|
||||
if (cmd.TimeoutMs) {
|
||||
var notification = {
|
||||
title: cmd.Header,
|
||||
body: cmd.Text,
|
||||
timeout: cmd.TimeoutMs
|
||||
};
|
||||
|
||||
WebNotifications.show(notification);
|
||||
} else {
|
||||
Dashboard.showFooterNotification({ html: "<b>" + cmd.Header + ": </b>" + cmd.Text, timeout: cmd.TimeoutMs });
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
onBrowseCommand: function (cmd) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue