Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix safari volume being reset when track changed #5923

Merged
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Fix volume being reset when track changed
gnattu committed Aug 17, 2024
commit 9595c7248e50add3dec902e2e7cfc30ca446477a
8 changes: 4 additions & 4 deletions src/plugins/htmlAudioPlayer/plugin.js
Original file line number Diff line number Diff line change
@@ -124,13 +124,13 @@ 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 = browser.safari ? elem.volume * self.normalizationGain : self.normalizationGain;
} else {
self.gainNode.gain.value = 1;
self.gainNode.gain.value = browser.safari ? elem.volume : 1;
self.normalizationGain = 1;
}
console.debug('gain: ' + self.gainNode.gain.value);
console.debug('gain: ' + self.normalizationGain);
}).catch((err) => {
console.error('Failed to add/change gainNode', err);
});
Loading