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

Merge pull request #5920 from gnattu/fix-safari-volume-10.9

This commit is contained in:
Bill Thornton 2024-08-17 13:44:41 -04:00 committed by GitHub
commit 90236c25ee
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 6 additions and 1 deletions

View file

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

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');
}
}