瀏覽代碼

[RN] Fix for creating video track when conference is ending.

master
Daniel Ornelas 7 年之前
父節點
當前提交
ad259988b9

+ 10
- 4
react/features/base/conference/actions.js 查看文件

@@ -451,15 +451,21 @@ export function p2pStatusChanged(p2p: boolean) {
451 451
  *
452 452
  * @param {boolean} audioOnly - True if the conference should be audio only;
453 453
  * false, otherwise.
454
+ * @param {boolean} ensureVideoTrack - Define if conference should ensure
455
+ * to create a video track.
454 456
  * @returns {{
455 457
  *     type: SET_AUDIO_ONLY,
456
- *     audioOnly: boolean
458
+ *     audioOnly: boolean,
459
+ *     ensureVideoTrack: boolean
457 460
  * }}
458 461
  */
459
-export function setAudioOnly(audioOnly: boolean) {
462
+export function setAudioOnly(
463
+        audioOnly: boolean,
464
+        ensureVideoTrack: boolean = false) {
460 465
     return {
461 466
         type: SET_AUDIO_ONLY,
462
-        audioOnly
467
+        audioOnly,
468
+        ensureVideoTrack
463 469
     };
464 470
 }
465 471
 
@@ -665,6 +671,6 @@ export function toggleAudioOnly() {
665 671
     return (dispatch: Dispatch<*>, getState: Function) => {
666 672
         const { audioOnly } = getState()['features/base/conference'];
667 673
 
668
-        return dispatch(setAudioOnly(!audioOnly));
674
+        return dispatch(setAudioOnly(!audioOnly, true));
669 675
     };
670 676
 }

+ 1
- 1
react/features/base/conference/middleware.js 查看文件

@@ -273,7 +273,7 @@ function _setAudioOnly({ dispatch, getState }, next, action) {
273 273
         setVideoMuted(
274 274
             newValue,
275 275
             VIDEO_MUTISM_AUTHORITY.AUDIO_ONLY,
276
-            /* ensureTrack */ true));
276
+            action.ensureVideoTrack));
277 277
 
278 278
     if (typeof APP !== 'undefined') {
279 279
         // TODO This should be a temporary solution that lasts only until video

+ 1
- 1
react/features/base/media/middleware.js 查看文件

@@ -162,7 +162,7 @@ function _setRoom({ dispatch, getState }, next, action) {
162 162
     sendAnalytics(createStartAudioOnlyEvent(audioOnly));
163 163
     logger.log(`Start audio only set to ${audioOnly.toString()}`);
164 164
 
165
-    dispatch(setAudioOnly(audioOnly));
165
+    dispatch(setAudioOnly(audioOnly, false));
166 166
 
167 167
     return next(action);
168 168
 }

+ 1
- 1
react/features/base/settings/middleware.js 查看文件

@@ -55,7 +55,7 @@ function _maybeSetAudioOnly(
55 55
         { dispatch },
56 56
         { settings: { startAudioOnly } }) {
57 57
     if (typeof startAudioOnly === 'boolean') {
58
-        dispatch(setAudioOnly(startAudioOnly));
58
+        dispatch(setAudioOnly(startAudioOnly, true));
59 59
     }
60 60
 }
61 61
 

Loading…
取消
儲存