Jitsi Meet - Secure, Simple and Scalable Video Conferences that you use as a standalone app or embed in your web application.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
jitsi-meet/react/features/remote-control/subscriber.js

33 lines
893 B

// @flow
import { StateListenerRegistry } from '../base/redux';
import { resume, pause } from './actions';
/**
* Listens for large video participant ID changes.
*/
StateListenerRegistry.register(
/* selector */ state => {
const { participantId } = state['features/large-video'];
const { controller } = state['features/remote-control'];
const { controlled } = controller;
if (!controlled) {
return undefined;
}
return controlled === participantId;
},
/* listener */ (isControlledParticipantOnStage, { dispatch }) => {
if (isControlledParticipantOnStage === true) {
dispatch(resume());
} else if (isControlledParticipantOnStage === false) {
dispatch(pause());
}
// else {
// isControlledParticipantOnStage === undefined. Ignore!
// }
}
);