From 35e363577c3073f2ef82601d4baa31e59d94da67 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sa=C3=BAl=20Ibarra=20Corretg=C3=A9?= Date: Fri, 24 Sep 2021 11:01:33 +0200 Subject: [PATCH] fix(ios) create audio track early In iOS 15 we observe that not creating the audio track early may result in not getting audio after unmuting for the first time. Creating the audio track early means the first unmute doesn't need to add the track to the conference, resulting in a much faster operation. Note that creating the track early doesn't mean we will start unmuted, the track will be muted. --- react/features/base/tracks/actions.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/react/features/base/tracks/actions.js b/react/features/base/tracks/actions.js index 3c73506dd..2933bc938 100644 --- a/react/features/base/tracks/actions.js +++ b/react/features/base/tracks/actions.js @@ -55,9 +55,12 @@ export function createDesiredLocalTracks(...desiredTypes) { dispatch(destroyLocalDesktopTrackIfExists()); if (desiredTypes.length === 0) { - const { audio, video } = state['features/base/media']; + const { video } = state['features/base/media']; - audio.muted || desiredTypes.push(MEDIA_TYPE.AUDIO); + // XXX: Always create the audio track early, even if it will be muted. + // This fixes a timing issue when adding the track to the conference which + // manifests primarily on iOS 15. + desiredTypes.push(MEDIA_TYPE.AUDIO); // XXX When the app is coming into the foreground from the // background in order to handle a URL, it may realize the new