mirror of
https://github.com/jellyfin/jellyfin-web.git
synced 2024-11-17 19:08:18 -07:00
Merge pull request #219 from Froghut/chromecast_volume_fix
Change Chromecast volume instead while casting
This commit is contained in:
commit
f6f51d79cc
@ -787,11 +787,16 @@ define(['appSettings', 'userSettings', 'playbackManager', 'connectionManager', '
|
||||
};
|
||||
|
||||
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 () {
|
||||
@ -806,24 +811,24 @@ define(['appSettings', 'userSettings', 'playbackManager', 'connectionManager', '
|
||||
};
|
||||
|
||||
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({
|
||||
options: {},
|
||||
command: 'VolumeUp'
|
||||
});
|
||||
this._castPlayer.session.setReceiverVolumeLevel(vol);
|
||||
};
|
||||
|
||||
ChromecastPlayer.prototype.setVolume = function (vol) {
|
||||
|
||||
vol = Math.min(vol, 100);
|
||||
vol = Math.max(vol, 0);
|
||||
vol = vol / 100;
|
||||
|
||||
this._castPlayer.sendMessage({
|
||||
options: {
|
||||
volume: vol
|
||||
},
|
||||
command: 'SetVolume'
|
||||
});
|
||||
this._castPlayer.session.setReceiverVolumeLevel(vol);
|
||||
};
|
||||
|
||||
ChromecastPlayer.prototype.unpause = function () {
|
||||
|
Loading…
Reference in New Issue
Block a user