mirror of
https://gitcode.com/GitHub_Trending/ji/jitsi-meet.git
synced 2025-12-30 11:22:31 +00:00
Fixes an issue where 'contentSharingParticipantsChanged' event and 'getContentSharingParticipants' API continue to list IDs of the participants that have already stopped their screenshares.
40 lines
1.1 KiB
TypeScript
40 lines
1.1 KiB
TypeScript
import _ from 'lodash';
|
|
|
|
import { getScreenshareParticipantIds } from '../participants/functions';
|
|
import StateListenerRegistry from '../redux/StateListenerRegistry';
|
|
|
|
import { isLocalCameraTrackMuted } from './functions';
|
|
|
|
/**
|
|
* Notifies when the list of currently sharing participants changes.
|
|
*/
|
|
StateListenerRegistry.register(
|
|
/* selector */ state => getScreenshareParticipantIds(state),
|
|
/* listener */ (participantIDs, store, previousParticipantIDs) => {
|
|
if (typeof APP !== 'object') {
|
|
return;
|
|
}
|
|
|
|
if (!_.isEqual(_.sortBy(participantIDs), _.sortBy(previousParticipantIDs))) {
|
|
APP.API.notifySharingParticipantsChanged(participantIDs);
|
|
}
|
|
}
|
|
);
|
|
|
|
|
|
/**
|
|
* Notifies when the local video mute state changes.
|
|
*/
|
|
StateListenerRegistry.register(
|
|
/* selector */ state => isLocalCameraTrackMuted(state['features/base/tracks']),
|
|
/* listener */ (muted, store, previousMuted) => {
|
|
if (typeof APP !== 'object') {
|
|
return;
|
|
}
|
|
|
|
if (muted !== previousMuted) {
|
|
APP.API.notifyVideoMutedStatusChanged(muted);
|
|
}
|
|
}
|
|
);
|