Jitsi Meet - Secure, Simple and Scalable Video Conferences that you use as a standalone app or embed in your web application.
TypeScript debiandeep-videojitsijitsi-meetscalable-video-conferencessfuvideovideo-communicationvideo-conferencingwebrtc
fix(tracks): resubscribe streaming status on p2p<->jvb track swap (#17495)
Дамян Минков7e282ee003fc
diff --git a/react/features/base/tracks/hooks.any.ts b/react/features/base/tracks/hooks.any.tsindex 3f51ece568..3d837b7e07 100644--- a/react/features/base/tracks/hooks.any.ts+++ b/react/features/base/tracks/hooks.any.ts@@ -14,10 +14,11 @@ import { ITrack } from './types';*/export function useTrackStreamingStatus(track: ITrack | undefined) {const dispatch = useDispatch();- const sourceName = track?.jitsiTrack?.getSourceName();+ const jitsiTrack = track?.jitsiTrack;+ const sourceName = jitsiTrack?.getSourceName();- const handleStreamingStatusChanged = (jitsiTrack: any, streamingStatus: string) => {- dispatch(trackStreamingStatusChanged(jitsiTrack, streamingStatus));+ const handleStreamingStatusChanged = (changedTrack: any, streamingStatus: string) => {+ dispatch(trackStreamingStatusChanged(changedTrack, streamingStatus));};useEffect(() => {@@ -32,5 +33,11 @@ export function useTrackStreamingStatus(track: ITrack | undefined) {track.jitsiTrack.off(JitsiTrackEvents.TRACK_STREAMING_STATUS_CHANGED, handleStreamingStatusChanged);dispatch(trackStreamingStatusChanged(track.jitsiTrack, track.jitsiTrack.getTrackStreamingStatus?.()));};- }, [ sourceName ]);++ // The dependency must be the track OBJECT, not its source name: on a P2P<->JVB switch the remote track is+ // replaced by a new JitsiRemoteTrack with the SAME source name. Keying on the source name leaves the+ // listener on the old (removed) track and nobody subscribed to the new one, so once its streaming status+ // tracker is disposed the status is stuck as null in redux and the tile falls back to the avatar while+ // video is in fact flowing.+ }, [ jitsiTrack, sourceName ]);}