fix(JitsiConference): handle mute state updates arriving before track creation#2956
Conversation
|
Hi, thanks for your contribution! |
Adds TRACK_AUDIO_MUTED_CHANGED and TRACK_VIDEO_MUTED_CHANGED events that emit when a participant's aggregate mute state changes. A participant is considered unmuted
if ANY source for that media type is unmuted.
Also fixes bug where sources weren't added when media type map didn't exist.
54261fd to
bb85db9
Compare
saghul
left a comment
There was a problem hiding this comment.
LGTM. @jallamsetty1 can you PTAL?
|
Jenkins please test this please. |
|
@mihhu The existing TRACK_MUTE_CHANGED events should fire for remote tracks as well. See andlib-jitsi-meet/JitsiConference.ts Line 3425 in 4078190 |
| ); | ||
|
|
||
| emitter.emit(JitsiConferenceEvents.TRACK_ADDED, track); | ||
|
|
There was a problem hiding this comment.
| // Always apply the final mute state (pending or current). | |
| const muteState = track._getPendingMuteState() ?? track.isMuted(); | |
| track._clearPendingMuteState(); | |
| track.setMute(muteState); |
There was a problem hiding this comment.
I am wondering if we should always call setMute() track. This should handle the case when presence is available during track creation and there are no subsequent mute events after that initial presence update.
There was a problem hiding this comment.
nevermind, I think case is already handled.
…k creation (jitsi#2956) * feat(JitsiParticipant): Add participant-level mute state change events Adds TRACK_AUDIO_MUTED_CHANGED and TRACK_VIDEO_MUTED_CHANGED events that emit when a participant's aggregate mute state changes. A participant is considered unmuted if ANY source for that media type is unmuted. Also fixes bug where sources weren't added when media type map didn't exist. * fix(JitsiConference): Emit TRACK_MUTE_CHANGED for initial remote track mute state * fix(JitsiConference): handle mute state updates arriving before track creation
Description
Fixes race condition where mute state updates can arrive via signaling before the corresponding remote track has been created, causing the initial TRACK_MUTE_CHANGED event to never be emitted.
How Has This Been Tested?
Checklist: