浏览代码

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,16 +838,6 @@ export function toggleCamera() {
838 838
         const localVideoTrack = getLocalVideoTrack(tracks)?.jitsiTrack;
839 839
         const currentFacingMode = localVideoTrack.getCameraFacingMode();
840 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 841
         const targetFacingMode = currentFacingMode === CAMERA_FACING_MODE.USER
852 842
             ? CAMERA_FACING_MODE.ENVIRONMENT
853 843
             : CAMERA_FACING_MODE.USER;
@@ -857,7 +847,6 @@ export function toggleCamera() {
857 847
 
858 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
 }

正在加载...
取消
保存