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).
j8
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,7 +320,7 @@ export function getTrackByMediaTypeAndParticipant(
320 320
         mediaType,
321 321
         participantId) {
322 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,7 +46,9 @@ MiddlewareRegistry.register(store => next => async action => {
46 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 53
         dispatch(setPrejoinPageVisibility(false));
52 54
         APP.conference.prejoinStart(jitsiTracks);

Loading…
Cancel
Save