Backport pull request #5923 from jellyfin-web/release-10.9.z
Fix safari volume being reset when track changed Original-merge: 6a8f21e462a4dbae7363847bf4f8b02adc66bcb0 Merged-by: thornbill <thornbill@users.noreply.github.com> Backported-by: Joshua M. Boniface <joshua@boniface.me>
This commit is contained in:
committed by
Joshua M. Boniface
parent
cceb1a5935
commit
286f9ab4e0
@@ -124,13 +124,17 @@ class HtmlAudioPlayer {
|
||||
}
|
||||
|
||||
if (normalizationGain) {
|
||||
self.gainNode.gain.value = Math.pow(10, normalizationGain / 20);
|
||||
self.normalizationGain = self.gainNode.gain.value;
|
||||
self.normalizationGain = Math.pow(10, normalizationGain / 20);
|
||||
self.gainNode.gain.value = self.normalizationGain;
|
||||
} else {
|
||||
self.gainNode.gain.value = 1;
|
||||
self.normalizationGain = 1;
|
||||
}
|
||||
console.debug('gain: ' + self.gainNode.gain.value);
|
||||
if (browser.safari) {
|
||||
// Gain value is absolute in Safari. Add volume from the slider
|
||||
self.gainNode.gain.value *= elem.volume;
|
||||
}
|
||||
console.debug('gain: ' + self.normalizationGain);
|
||||
}).catch((err) => {
|
||||
console.error('Failed to add/change gainNode', err);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user