Skip to content

🎧 Your Personal Streaming Service

Only create context if gain mode active (#2173)

Kendall Garnerb129cae0d8b1
diff --git a/ui/src/audioplayer/Player.js b/ui/src/audioplayer/Player.js
index 245b099bf..73f17f266 100644
--- a/ui/src/audioplayer/Player.js
+++ b/ui/src/audioplayer/Player.js
@@ -69,7 +69,8 @@ const Player = () => {
context === null &&
audioInstance &&
config.enableReplayGain &&
- 'AudioContext' in window
+ 'AudioContext' in window &&
+ (gainInfo.gainMode === 'album' || gainInfo.gainMode === 'track')
) {
const ctx = new AudioContext()
// we need this to support radios in firefox
@@ -83,7 +84,7 @@ const Player = () => {
setContext(ctx)
setGainNode(gain)
}
- }, [audioInstance, context])
+ }, [audioInstance, context, gainInfo.gainMode])
useEffect(() => {
if (gainNode) {