瀏覽代碼

fix(prejoin): Don't add video track to connection on start if video muted

j8
Vlad Piersec 4 年之前
父節點
當前提交
3538761543
共有 2 個檔案被更改,包括 14 行新增17 行删除
  1. 3
    15
      react/features/prejoin/actions.js
  2. 11
    2
      react/features/prejoin/middleware.js

+ 3
- 15
react/features/prejoin/actions.js 查看文件

@@ -199,14 +199,13 @@ export function initPrejoin(tracks: Object[], errors: Object) {
199 199
 }
200 200
 
201 201
 /**
202
- * Joins the conference.
202
+ * Action used to start the conference.
203 203
  *
204 204
  * @returns {Function}
205 205
  */
206 206
 export function joinConference() {
207
-    return function(dispatch: Function) {
208
-        dispatch(setPrejoinPageVisibility(false));
209
-        dispatch(startConference());
207
+    return {
208
+        type: PREJOIN_START_CONFERENCE
210 209
     };
211 210
 }
212 211
 
@@ -418,14 +417,3 @@ export function setPrejoinPageVisibility(value: boolean) {
418 417
         value
419 418
     };
420 419
 }
421
-
422
-/**
423
- * Action used to mark the start of the conference.
424
- *
425
- * @returns {Object}
426
- */
427
-function startConference() {
428
-    return {
429
-        type: PREJOIN_START_CONFERENCE
430
-    };
431
-}

+ 11
- 2
react/features/prejoin/middleware.js 查看文件

@@ -2,8 +2,10 @@
2 2
 
3 3
 import { MiddlewareRegistry } from '../base/redux';
4 4
 import { updateSettings } from '../base/settings';
5
+import { getLocalVideoTrack, replaceLocalTrack } from '../base/tracks';
5 6
 
6 7
 import { PREJOIN_START_CONFERENCE } from './actionTypes';
8
+import { setPrejoinPageVisibility } from './actions';
7 9
 
8 10
 declare var APP: Object;
9 11
 
@@ -19,13 +21,20 @@ MiddlewareRegistry.register(store => next => async action => {
19 21
         const { getState, dispatch } = store;
20 22
         const state = getState();
21 23
         const { userSelectedSkipPrejoin } = state['features/prejoin'];
22
-        const tracks = state['features/base/tracks'];
24
+        const localVideoTrack = getLocalVideoTrack(state['features/base/tracks']);
23 25
 
24 26
         userSelectedSkipPrejoin && dispatch(updateSettings({
25 27
             userSelectedSkipPrejoin
26 28
         }));
27 29
 
28
-        APP.conference.prejoinStart(tracks.map(t => t.jitsiTrack));
30
+        if (localVideoTrack?.muted) {
31
+            await dispatch(replaceLocalTrack(localVideoTrack.jitsiTrack, null));
32
+        }
33
+
34
+        const jitsiTracks = getState()['features/base/tracks'].map(t => t.jitsiTrack);
35
+
36
+        dispatch(setPrejoinPageVisibility(false));
37
+        APP.conference.prejoinStart(jitsiTracks);
29 38
 
30 39
         break;
31 40
     }

Loading…
取消
儲存