浏览代码

fix(tests): Add more checks so that test don't error out.

j8
Jaya Allamsetty 4 年前
父节点
当前提交
fd313c1af7
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 2
    2
      react/features/base/testing/functions.js

+ 2
- 2
react/features/base/testing/functions.js 查看文件

38
     const largeVideoParticipantId = getState()['features/large-video'].participantId;
38
     const largeVideoParticipantId = getState()['features/large-video'].participantId;
39
     const videoTrack = getTrackByMediaTypeAndParticipant(
39
     const videoTrack = getTrackByMediaTypeAndParticipant(
40
         getState()['features/base/tracks'], MEDIA_TYPE.VIDEO, largeVideoParticipantId);
40
         getState()['features/base/tracks'], MEDIA_TYPE.VIDEO, largeVideoParticipantId);
41
-    const lastMediaEvent = getState()['features/large-video'].lastMediaEvent;
41
+    const lastMediaEvent = getState()['features/large-video']?.lastMediaEvent;
42
 
42
 
43
     return videoTrack && !videoTrack.muted && (lastMediaEvent === 'playing' || lastMediaEvent === 'canplaythrough');
43
     return videoTrack && !videoTrack.muted && (lastMediaEvent === 'playing' || lastMediaEvent === 'canplaythrough');
44
 }
44
 }
54
     const videoTrack = getTrackByMediaTypeAndParticipant(getState()['features/base/tracks'], MEDIA_TYPE.VIDEO, id);
54
     const videoTrack = getTrackByMediaTypeAndParticipant(getState()['features/base/tracks'], MEDIA_TYPE.VIDEO, id);
55
     const lastMediaEvent = videoTrack?.lastMediaEvent;
55
     const lastMediaEvent = videoTrack?.lastMediaEvent;
56
 
56
 
57
-    return !videoTrack.muted && (lastMediaEvent === 'playing' || lastMediaEvent === 'canplaythrough');
57
+    return videoTrack && !videoTrack.muted && (lastMediaEvent === 'playing' || lastMediaEvent === 'canplaythrough');
58
 }
58
 }

正在加载...
取消
保存