Skip to content

Commit 90236c2

Browse files
authored
Merge pull request jellyfin#5920 from gnattu/fix-safari-volume-10.9
2 parents 8bc9544 + 2305240 commit 90236c2

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

src/components/apphost.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ const supportedFeatures = function () {
242242
features.push('fullscreenchange');
243243
}
244244

245-
if (browser.tv || browser.xboxOne || browser.ps4 || browser.mobile) {
245+
if (browser.tv || browser.xboxOne || browser.ps4 || browser.mobile || browser.ipad) {
246246
features.push('physicalvolumecontrol');
247247
}
248248

src/plugins/htmlAudioPlayer/plugin.js

+5
Original file line numberDiff line numberDiff line change
@@ -125,8 +125,10 @@ class HtmlAudioPlayer {
125125

126126
if (normalizationGain) {
127127
self.gainNode.gain.value = Math.pow(10, normalizationGain / 20);
128+
self.normalizationGain = self.gainNode.gain.value;
128129
} else {
129130
self.gainNode.gain.value = 1;
131+
self.normalizationGain = 1;
130132
}
131133
console.debug('gain: ' + self.gainNode.gain.value);
132134
}).catch((err) => {
@@ -311,6 +313,9 @@ class HtmlAudioPlayer {
311313
function onVolumeChange() {
312314
if (!self._isFadingOut) {
313315
htmlMediaHelper.saveVolume(this.volume);
316+
if (browser.safari) {
317+
self.gainNode.gain.value = this.volume * self.normalizationGain;
318+
}
314319
Events.trigger(self, 'volumechange');
315320
}
316321
}

0 commit comments

Comments
 (0)