Browse Source

fix: TypeError: Cannot read property 'isAudioTrack' of undefined

When there's no jitsiTrack set on the base/tracks entry it means
a track is being created (get user media is in progress).
master
Pawel Domas 4 years ago
parent
commit
e0aab11f98
2 changed files with 4 additions and 2 deletions
  1. 1
    1
      react/features/base/tracks/functions.js
  2. 3
    1
      react/features/prejoin/middleware.js

+ 1
- 1
react/features/base/tracks/functions.js View File

320
         mediaType,
320
         mediaType,
321
         participantId) {
321
         participantId) {
322
     return tracks.find(
322
     return tracks.find(
323
-        t => t.participantId === participantId && t.mediaType === mediaType
323
+        t => Boolean(t.jitsiTrack) && t.participantId === participantId && t.mediaType === mediaType
324
     );
324
     );
325
 }
325
 }
326
 
326
 

+ 3
- 1
react/features/prejoin/middleware.js View File

46
             await dispatch(replaceLocalTrack(localVideoTrack.jitsiTrack, null));
46
             await dispatch(replaceLocalTrack(localVideoTrack.jitsiTrack, null));
47
         }
47
         }
48
 
48
 
49
-        const jitsiTracks = getState()['features/base/tracks'].map(t => t.jitsiTrack);
49
+        const jitsiTracks = getState()['features/base/tracks']
50
+            .map(t => t.jitsiTrack)
51
+            .filter(t => Boolean(t)); // Filter out GUM in progress tracks...
50
 
52
 
51
         dispatch(setPrejoinPageVisibility(false));
53
         dispatch(setPrejoinPageVisibility(false));
52
         APP.conference.prejoinStart(jitsiTracks);
54
         APP.conference.prejoinStart(jitsiTracks);

Loading…
Cancel
Save