fix(rn,conference) fix unmute when "everyone starts muted" is set

Since iOS 15 we really need the audio stream to exist, so make sure we don't
destroy it even when "everyone starts muted" is set, we'll just mute it.

Fixes: https://github.com/jitsi/jitsi-meet/issues/10053
This commit is contained in:
Saúl Ibarra Corretgé 2021-10-01 14:04:34 +02:00 committed by Saúl Ibarra Corretgé
parent eb494f6b8c
commit 51626506ff
1 changed files with 5 additions and 2 deletions

View File

@ -135,8 +135,11 @@ function _addConferenceListeners(conference, dispatch, state) {
// Remove the tracks from peerconnection as well. // Remove the tracks from peerconnection as well.
for (const track of localTracks) { for (const track of localTracks) {
if ((audioMuted && track.jitsiTrack.getType() === MEDIA_TYPE.AUDIO) const trackType = track.jitsiTrack.getType();
|| (videoMuted && track.jitsiTrack.getType() === MEDIA_TYPE.VIDEO)) {
// Do not remove the audio track on RN. Starting with iOS 15 it will fail to unmute otherwise.
if ((audioMuted && trackType === MEDIA_TYPE.AUDIO && navigator.product !== 'ReactNative')
|| (videoMuted && trackType === MEDIA_TYPE.VIDEO)) {
dispatch(replaceLocalTrack(track.jitsiTrack, null, conference)); dispatch(replaceLocalTrack(track.jitsiTrack, null, conference));
} }
} }