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

Backport pull request #5920 from jellyfin-web/release-10.9.z

Fix Safari volume control

Original-merge: 90236c25ee

Merged-by: thornbill <thornbill@users.noreply.github.com>

Backported-by: Joshua M. Boniface <joshua@boniface.me>
This commit is contained in:
gnattu 2024-08-25 02:47:25 -04:00 committed by Joshua M. Boniface
parent 9a3cba06d1
commit cceb1a5935
2 changed files with 6 additions and 1 deletions

View file

@ -272,7 +272,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');
}

View file

@ -125,8 +125,10 @@ class HtmlAudioPlayer {
if (normalizationGain) {
self.gainNode.gain.value = Math.pow(10, normalizationGain / 20);
self.normalizationGain = self.gainNode.gain.value;
} 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');
}
}