浏览代码

fix(iFrame): capturScreenshot - check if the remote participant has a track attached.

Participants that join video muted do not have video tracks attached. Fixes https://github.com/jitsi/jitsi-meet/issues/7942.
master
Jaya Allamsetty 5 年前
父节点
当前提交
4b429112f2
共有 1 个文件被更改,包括 14 次插入4 次删除
  1. 14
    4
      react/features/large-video/actions.web.js

+ 14
- 4
react/features/large-video/actions.web.js 查看文件

17
     return (dispatch: Dispatch<any>, getState: Function): Promise<string> => {
17
     return (dispatch: Dispatch<any>, getState: Function): Promise<string> => {
18
         const state = getState();
18
         const state = getState();
19
         const largeVideo = state['features/large-video'];
19
         const largeVideo = state['features/large-video'];
20
+        const promise = Promise.resolve();
20
 
21
 
21
         if (!largeVideo) {
22
         if (!largeVideo) {
22
-            return Promise.resolve();
23
+            return promise;
23
         }
24
         }
24
         const tracks = state['features/base/tracks'];
25
         const tracks = state['features/base/tracks'];
25
-        const { jitsiTrack } = getTrackByMediaTypeAndParticipant(tracks, MEDIA_TYPE.VIDEO, largeVideo.participantId);
26
-        const videoStream = jitsiTrack.getOriginalStream();
26
+        const participantTrack = getTrackByMediaTypeAndParticipant(tracks, MEDIA_TYPE.VIDEO, largeVideo.participantId);
27
+
28
+        // Participants that join the call video muted do not have a jitsiTrack attached.
29
+        if (!(participantTrack && participantTrack.jitsiTrack)) {
30
+            return promise;
31
+        }
32
+        const videoStream = participantTrack.jitsiTrack.getOriginalStream();
33
+
34
+        if (!videoStream) {
35
+            return promise;
36
+        }
27
 
37
 
28
         // Get the video element for the large video, cast HTMLElement to HTMLVideoElement to make flow happy.
38
         // Get the video element for the large video, cast HTMLElement to HTMLVideoElement to make flow happy.
29
         /* eslint-disable-next-line no-extra-parens*/
39
         /* eslint-disable-next-line no-extra-parens*/
30
         const videoElement = ((document.getElementById('largeVideo'): any): HTMLVideoElement);
40
         const videoElement = ((document.getElementById('largeVideo'): any): HTMLVideoElement);
31
 
41
 
32
         if (!videoElement) {
42
         if (!videoElement) {
33
-            return Promise.resolve();
43
+            return promise;
34
         }
44
         }
35
 
45
 
36
         // Create a HTML canvas and draw video on to the canvas.
46
         // Create a HTML canvas and draw video on to the canvas.

正在加载...
取消
保存