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 () {
|
self.mute = function () {
|
||||||
currentMediaElement.volume = 0;
|
|
||||||
|
if (currentMediaElement) {
|
||||||
|
currentMediaElement.volume = 0;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
self.unmute = function () {
|
self.unmute = function () {
|
||||||
currentMediaElement.volume = volumeSlider.val();
|
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 () {
|
self.stop = function () {
|
||||||
|
|
|
@ -74,7 +74,7 @@ var Dashboard = {
|
||||||
header.remove();
|
header.remove();
|
||||||
|
|
||||||
if (Dashboard.getUserPromise) {
|
if (Dashboard.getUserPromise) {
|
||||||
Dashboard.getUserPromise.done(function(user) {
|
Dashboard.getUserPromise.done(function (user) {
|
||||||
Dashboard.ensureHeader(page, user);
|
Dashboard.ensureHeader(page, user);
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
|
@ -812,6 +812,48 @@ var Dashboard = {
|
||||||
MediaPlayer.previousTrack();
|
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) {
|
onBrowseCommand: function (cmd) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue