瀏覽代碼

fix(tracks) Replace the tracks directly on camera toggle.

Fixes an issue where p2p peer stops rendering remote video when the mobile client toggles camera. This happens only when the peer starts video muted.
factor2
Jaya Allamsetty 4 月之前
父節點
當前提交
db4ab34ddf
共有 1 個檔案被更改,包括 1 行新增12 行删除
  1. 1
    12
      react/features/base/tracks/actions.any.ts

+ 1
- 12
react/features/base/tracks/actions.any.ts 查看文件

838
         const localVideoTrack = getLocalVideoTrack(tracks)?.jitsiTrack;
838
         const localVideoTrack = getLocalVideoTrack(tracks)?.jitsiTrack;
839
         const currentFacingMode = localVideoTrack.getCameraFacingMode();
839
         const currentFacingMode = localVideoTrack.getCameraFacingMode();
840
         const { localFlipX } = state['features/base/settings'];
840
         const { localFlipX } = state['features/base/settings'];
841
-
842
-        /**
843
-         * FIXME: Ideally, we should be dispatching {@code replaceLocalTrack} here,
844
-         * but it seems to not trigger the re-rendering of the local video on Chrome;
845
-         * could be due to a plan B vs unified plan issue. Therefore, we use the legacy
846
-         * method defined in conference.js that manually takes care of updating the local
847
-         * video as well.
848
-         */
849
-        await APP.conference.useVideoStream(null);
850
-
851
         const targetFacingMode = currentFacingMode === CAMERA_FACING_MODE.USER
841
         const targetFacingMode = currentFacingMode === CAMERA_FACING_MODE.USER
852
             ? CAMERA_FACING_MODE.ENVIRONMENT
842
             ? CAMERA_FACING_MODE.ENVIRONMENT
853
             : CAMERA_FACING_MODE.USER;
843
             : CAMERA_FACING_MODE.USER;
857
 
847
 
858
         const newVideoTrack = await createLocalTrack('video', null, null, { facingMode: targetFacingMode });
848
         const newVideoTrack = await createLocalTrack('video', null, null, { facingMode: targetFacingMode });
859
 
849
 
860
-        // FIXME: See above.
861
-        await APP.conference.useVideoStream(newVideoTrack);
850
+        dispatch(replaceLocalTrack(localVideoTrack, newVideoTrack));
862
     };
851
     };
863
 }
852
 }

Loading…
取消
儲存