summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDaniel Calviño Sánchez <danxuliu@gmail.com>2024-06-18 11:29:23 +0200
committerDaniel Calviño Sánchez <danxuliu@gmail.com>2024-06-18 11:29:23 +0200
commitf9d8cac514049ad7348d297d1c6c8b842ed2cb0e (patch)
treef86d9b5715afea3f2a7407c3c9eeb53e9ac7f31c /src
parent7f1ed1a70daeb9414f795fa706130537ade8e166 (diff)
fix: Fix broken audio in Safari after disconnecting node
It seems that Safari loops the audio buffer (or something like that) when disconnecting an audio node from a destination node being played, so if a remote participant mutes while speaking Safari plays weird noises. To work around that now the source of the output media element is set again whenever a node is disconnected to force creating a new audio renderer. Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
Diffstat (limited to 'src')
-rw-r--r--src/utils/webrtc/CallParticipantsAudioPlayer.js4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/utils/webrtc/CallParticipantsAudioPlayer.js b/src/utils/webrtc/CallParticipantsAudioPlayer.js
index 4c366e900..90ca6730d 100644
--- a/src/utils/webrtc/CallParticipantsAudioPlayer.js
+++ b/src/utils/webrtc/CallParticipantsAudioPlayer.js
@@ -162,6 +162,10 @@ CallParticipantsAudioPlayer.prototype = {
} else if (!audioAvailable && audioNode.connected) {
audioNode.audioSource.disconnect(this._audioDestination)
audioNode.connected = false
+
+ // Force creating a new audio renderer to work around broken
+ // audio output in Safari after disconnecting a node.
+ this._audioElement.srcObject = this._audioDestination.stream
}
return