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

support sending nav commands

This commit is contained in:
Luke Pulverenti 2014-04-27 21:57:29 -04:00
parent d619275f90
commit 093ee4c866
7 changed files with 138 additions and 32 deletions

View file

@ -726,6 +726,49 @@
});
};
self.sendCommand = function (cmd) {
// Full list
// https://github.com/MediaBrowser/MediaBrowser/blob/master/MediaBrowser.Model/Session/GeneralCommand.cs#L23
switch (cmd.Name) {
case 'VolumeUp':
self.volumeUp();
break;
case 'VolumeDown':
self.volumeDown();
break;
case 'Mute':
self.mute();
break;
case 'Unmute':
self.unMute();
break;
case 'ToggleMute':
self.toggleMute();
break;
case 'SetVolume':
self.setVolume(cmd.Arguments.Volume);
break;
case 'SetAudioStreamIndex':
break;
case 'SetSubtitleStreamIndex':
break;
case 'ToggleFullscreen':
if (currentItem && currentItem.MediaType == 'Video') {
self.toggleFullscreen();
}
break;
default:
// Not player-related
Dashboard.processGeneralCommand(cmd);
}
};
self.pause = function () {
currentMediaElement.pause();
@ -998,7 +1041,7 @@
state.NowPlayingItem = state.NowPlayingItem || {};
var nowPlayingItem = state.NowPlayingItem;
nowPlayingItem.Id = item.Id;
nowPlayingItem.MediaType = item.MediaType;
nowPlayingItem.Type = item.Type;