Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/spreed.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/src/utils
diff options
context:
space:
mode:
authorDaniel Calviño Sánchez <danxuliu@gmail.com>2022-03-17 07:56:58 +0300
committerDaniel Calviño Sánchez <danxuliu@gmail.com>2022-03-17 07:56:58 +0300
commit8c7461590e726f927e9266ef794f4e5d2c55f3a0 (patch)
tree8e26ec803e62fb95d5016f561ffaed013a898d4a /src/utils
parent04386a33411d453f3be8dd1fb4f1728f6a18313b (diff)
Fix call flags update when track is disabled
When the call flags were updated after a renegotiation the senders were checked to decide the flags to set. However, only the track attribute was checked; when a track is disabled the track is nullified in the sender and stored in "trackDisabled" instead, so the call flags were not properly set if any of the tracks was disabled when a new one was added. Note that when a local track is replaced the call flags are updated and, in that case, the right flags are used, so sometimes this issue could be masked by that. Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
Diffstat (limited to 'src/utils')
-rw-r--r--src/utils/webrtc/webrtc.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/utils/webrtc/webrtc.js b/src/utils/webrtc/webrtc.js
index 2d497e19f..bf56c57f6 100644
--- a/src/utils/webrtc/webrtc.js
+++ b/src/utils/webrtc/webrtc.js
@@ -935,8 +935,8 @@ export default function initWebRtc(signaling, _callParticipantCollection, _local
if (peer.pc.iceConnectionState !== 'new' && peer.pc.iceConnectionState !== 'checking') {
// Update the media flags if needed, as the renegotiation could
// have been caused by tracks being added or removed.
- const audioSender = peer.pc.getSenders().find((sender) => sender.track && sender.track.kind === 'audio')
- const videoSender = peer.pc.getSenders().find((sender) => sender.track && sender.track.kind === 'video')
+ const audioSender = peer.pc.getSenders().find((sender) => (sender.track && sender.track.kind === 'audio') || (sender.trackDisabled && sender.trackDisabled.kind === 'audio'))
+ const videoSender = peer.pc.getSenders().find((sender) => (sender.track && sender.track.kind === 'video') || (sender.trackDisabled && sender.trackDisabled.kind === 'video'))
let flags = signaling.getCurrentCallFlags()
if (audioSender) {