mirror of
https://gitcode.com/GitHub_Trending/ji/jitsi-meet.git
synced 2025-12-30 11:22:31 +00:00
Fixes #14491. When a screensharing participant leaves and is unmuted or sharing the tab audio, there is a dominant speaker changed event which stores wrong values in filmstrip state. And because we skip reordering when there is no filmstrip scroll and no screensharers to avoid reordering on every dominant speaker event for small meetings, we fail to evaluate that the screensharere is actually gone and we still show it. This will not happen if the one sharing is not dominant speaker (muted) or if there are more participants in the meeting (there is a scroll).
36 lines
1.6 KiB
TypeScript
36 lines
1.6 KiB
TypeScript
import StateListenerRegistry from '../base/redux/StateListenerRegistry';
|
|
|
|
import { isFilmstripScrollVisible, updateRemoteParticipants } from './functions';
|
|
|
|
/**
|
|
* Listens for changes to the screensharing status of the remote participants to recompute the reordered list of the
|
|
* remote endpoints.
|
|
*/
|
|
StateListenerRegistry.register(
|
|
/* selector */ state => state['features/video-layout'].remoteScreenShares,
|
|
/* listener */ (remoteScreenShares, store) => updateRemoteParticipants(store));
|
|
|
|
/**
|
|
* Listens for changes to the remote screenshare participants to recompute the reordered list of the remote endpoints.
|
|
* We force updateRemoteParticipants to make sure it executes and for the case where
|
|
* sortedRemoteVirtualScreenshareParticipants becomes 0. We do not want to short circuit it in case of no screen-sharers
|
|
* and no scroll and triggered for dominant speaker changed.
|
|
*/
|
|
StateListenerRegistry.register(
|
|
/* selector */ state => state['features/base/participants'].sortedRemoteVirtualScreenshareParticipants,
|
|
/* listener */ (sortedRemoteVirtualScreenshareParticipants, store) => updateRemoteParticipants(store, true));
|
|
|
|
/**
|
|
* Listens for changes to the dominant speaker to recompute the reordered list of the remote endpoints.
|
|
*/
|
|
StateListenerRegistry.register(
|
|
/* selector */ state => state['features/base/participants'].dominantSpeaker,
|
|
/* listener */ (dominantSpeaker, store) => updateRemoteParticipants(store));
|
|
|
|
/**
|
|
* Listens for changes in the filmstrip scroll visibility.
|
|
*/
|
|
StateListenerRegistry.register(
|
|
/* selector */ state => isFilmstripScrollVisible(state),
|
|
/* listener */ (_, store) => updateRemoteParticipants(store));
|