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.
This commit is contained in:
parent
e06ad6cea9
commit
c89791069b
@ -4,7 +4,8 @@ import {
|
|||||||
DOMINANT_SPEAKER_CHANGED,
|
DOMINANT_SPEAKER_CHANGED,
|
||||||
PARTICIPANT_JOINED,
|
PARTICIPANT_JOINED,
|
||||||
PARTICIPANT_LEFT,
|
PARTICIPANT_LEFT,
|
||||||
PIN_PARTICIPANT
|
PIN_PARTICIPANT,
|
||||||
|
getLocalParticipant
|
||||||
} from '../base/participants';
|
} from '../base/participants';
|
||||||
import { MiddlewareRegistry } from '../base/redux';
|
import { MiddlewareRegistry } from '../base/redux';
|
||||||
import {
|
import {
|
||||||
@ -27,7 +28,16 @@ MiddlewareRegistry.register(store => next => action => {
|
|||||||
const result = next(action);
|
const result = next(action);
|
||||||
|
|
||||||
switch (action.type) {
|
switch (action.type) {
|
||||||
case DOMINANT_SPEAKER_CHANGED:
|
case DOMINANT_SPEAKER_CHANGED: {
|
||||||
|
const localParticipant = getLocalParticipant(store.getState());
|
||||||
|
|
||||||
|
if (localParticipant && localParticipant.id !== action.participant.id) {
|
||||||
|
store.dispatch(selectParticipantInLargeVideo());
|
||||||
|
}
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
case PARTICIPANT_JOINED:
|
case PARTICIPANT_JOINED:
|
||||||
case PARTICIPANT_LEFT:
|
case PARTICIPANT_LEFT:
|
||||||
case PIN_PARTICIPANT:
|
case PIN_PARTICIPANT:
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user