浏览代码

fix(large-video): do not reselect video on self dominant speaker

In the current middleware logic, when the local participant becomes
dominant speaker, a new participant can be selected to receive
high quality video from. This means large-video could potentially
do a switch to another participant when the local participant
becomes dominant speaker. Prevent such behavior.
master
Leonard Kim 7 年前
父节点
当前提交
c89791069b
共有 1 个文件被更改,包括 12 次插入2 次删除
  1. 12
    2
      react/features/large-video/middleware.js

+ 12
- 2
react/features/large-video/middleware.js 查看文件

@@ -4,7 +4,8 @@ import {
4 4
     DOMINANT_SPEAKER_CHANGED,
5 5
     PARTICIPANT_JOINED,
6 6
     PARTICIPANT_LEFT,
7
-    PIN_PARTICIPANT
7
+    PIN_PARTICIPANT,
8
+    getLocalParticipant
8 9
 } from '../base/participants';
9 10
 import { MiddlewareRegistry } from '../base/redux';
10 11
 import {
@@ -27,7 +28,16 @@ MiddlewareRegistry.register(store => next => action => {
27 28
     const result = next(action);
28 29
 
29 30
     switch (action.type) {
30
-    case DOMINANT_SPEAKER_CHANGED:
31
+    case DOMINANT_SPEAKER_CHANGED: {
32
+        const localParticipant = getLocalParticipant(store.getState());
33
+
34
+        if (localParticipant && localParticipant.id !== action.participant.id) {
35
+            store.dispatch(selectParticipantInLargeVideo());
36
+        }
37
+
38
+        break;
39
+    }
40
+
31 41
     case PARTICIPANT_JOINED:
32 42
     case PARTICIPANT_LEFT:
33 43
     case PIN_PARTICIPANT:

正在加载...
取消
保存