diff --git a/src/components/apphost.js b/src/components/apphost.js index 742476195d6f..fbb28aa56c1f 100644 --- a/src/components/apphost.js +++ b/src/components/apphost.js @@ -242,7 +242,7 @@ const supportedFeatures = function () { features.push('fullscreenchange'); } - if (browser.tv || browser.xboxOne || browser.ps4 || browser.mobile) { + if (browser.tv || browser.xboxOne || browser.ps4 || browser.mobile || browser.ipad) { features.push('physicalvolumecontrol'); } diff --git a/src/plugins/htmlAudioPlayer/plugin.js b/src/plugins/htmlAudioPlayer/plugin.js index 34b573317d47..3505fa63277b 100644 --- a/src/plugins/htmlAudioPlayer/plugin.js +++ b/src/plugins/htmlAudioPlayer/plugin.js @@ -125,8 +125,10 @@ class HtmlAudioPlayer { if (normalizationGain) { self.gainNode.gain.value = Math.pow(10, normalizationGain / 20); + self.normalizationGain = normalizationGain; } else { self.gainNode.gain.value = 1; + self.normalizationGain = 1; } console.debug('gain: ' + self.gainNode.gain.value); }).catch((err) => { @@ -311,6 +313,9 @@ class HtmlAudioPlayer { function onVolumeChange() { if (!self._isFadingOut) { htmlMediaHelper.saveVolume(this.volume); + if (browser.safari) { + self.gainNode.gain.value = this.volume * self.normalizationGain; + } Events.trigger(self, 'volumechange'); } }