add braces for clarification

This commit is contained in:
Froghut 2019-04-01 15:34:01 +02:00
parent 732d8b5e26
commit 37f63f6963

View File

@ -782,7 +782,9 @@ define(['appSettings', 'userSettings', 'playbackManager', 'connectionManager', '
ChromecastPlayer.prototype.volumeDown = function () { ChromecastPlayer.prototype.volumeDown = function () {
vol = this._castPlayer.session.receiver.volume.level; vol = this._castPlayer.session.receiver.volume.level;
if (vol == null) if (vol == null)
{
vol = 0.5; vol = 0.5;
}
vol -= 0.02; vol -= 0.02;
vol = Math.max(vol, 0); vol = Math.max(vol, 0);
@ -804,7 +806,9 @@ define(['appSettings', 'userSettings', 'playbackManager', 'connectionManager', '
ChromecastPlayer.prototype.volumeUp = function () { ChromecastPlayer.prototype.volumeUp = function () {
vol = this._castPlayer.session.receiver.volume.level; vol = this._castPlayer.session.receiver.volume.level;
if (vol == null) if (vol == null)
{
vol = 0.5; vol = 0.5;
}
vol += 0.02; vol += 0.02;
vol = Math.min(vol, 1); vol = Math.min(vol, 1);