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

When changing volume connected to chromecast change the device volume instead of the jellyfin-player volume

This commit is contained in:
Froghut 2019-03-31 12:05:54 +02:00
parent 9677981344
commit 732d8b5e26

View file

@ -780,11 +780,14 @@ define(['appSettings', 'userSettings', 'playbackManager', 'connectionManager', '
}; };
ChromecastPlayer.prototype.volumeDown = function () { ChromecastPlayer.prototype.volumeDown = function () {
vol = this._castPlayer.session.receiver.volume.level;
if (vol == null)
vol = 0.5;
vol -= 0.02;
vol = Math.max(vol, 0);
this._castPlayer.session.setReceiverVolumeLevel(vol);
this._castPlayer.sendMessage({
options: {},
command: 'VolumeDown'
});
}; };
ChromecastPlayer.prototype.endSession = function () { ChromecastPlayer.prototype.endSession = function () {
@ -799,24 +802,22 @@ define(['appSettings', 'userSettings', 'playbackManager', 'connectionManager', '
}; };
ChromecastPlayer.prototype.volumeUp = function () { ChromecastPlayer.prototype.volumeUp = function () {
vol = this._castPlayer.session.receiver.volume.level;
if (vol == null)
vol = 0.5;
vol += 0.02;
vol = Math.min(vol, 1);
this._castPlayer.sendMessage({ this._castPlayer.session.setReceiverVolumeLevel(vol);
options: {},
command: 'VolumeUp'
});
}; };
ChromecastPlayer.prototype.setVolume = function (vol) { ChromecastPlayer.prototype.setVolume = function (vol) {
vol = Math.min(vol, 100); vol = Math.min(vol, 100);
vol = Math.max(vol, 0); vol = Math.max(vol, 0);
vol = vol / 100;
this._castPlayer.sendMessage({ this._castPlayer.session.setReceiverVolumeLevel(vol);
options: {
volume: vol
},
command: 'SetVolume'
});
}; };
ChromecastPlayer.prototype.unpause = function () { ChromecastPlayer.prototype.unpause = function () {