1
0
Fork 0
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:
Luke Pulverenti 2013-08-28 00:31:34 -04:00
parent ce67f87714
commit c1819ff31f
2 changed files with 74 additions and 6 deletions

View file

@ -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 () {

View file

@ -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 + ":&nbsp;&nbsp;&nbsp;</b>" + cmd.Text, timeout: cmd.TimeoutMs });
}
}
},
onBrowseCommand: function (cmd) {