Browse Source

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.
master
Saúl Ibarra Corretgé 4 years ago
parent
commit
35e363577c
1 changed files with 5 additions and 2 deletions
  1. 5
    2
      react/features/base/tracks/actions.js

+ 5
- 2
react/features/base/tracks/actions.js View File

55
         dispatch(destroyLocalDesktopTrackIfExists());
55
         dispatch(destroyLocalDesktopTrackIfExists());
56
 
56
 
57
         if (desiredTypes.length === 0) {
57
         if (desiredTypes.length === 0) {
58
-            const { audio, video } = state['features/base/media'];
58
+            const { video } = state['features/base/media'];
59
 
59
 
60
-            audio.muted || desiredTypes.push(MEDIA_TYPE.AUDIO);
60
+            // XXX: Always create the audio track early, even if it will be muted.
61
+            // This fixes a timing issue when adding the track to the conference which
62
+            // manifests primarily on iOS 15.
63
+            desiredTypes.push(MEDIA_TYPE.AUDIO);
61
 
64
 
62
             // XXX When the app is coming into the foreground from the
65
             // XXX When the app is coming into the foreground from the
63
             // background in order to handle a URL, it may realize the new
66
             // background in order to handle a URL, it may realize the new

Loading…
Cancel
Save