fix: update call participant video state when changed [WPB-2494] #15421
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes the issue where video/screenshare of other call participants is not visible after rejoining the call.
We initialise call participants with video state
0
(STOPPED
). Previously we were just listening tovideoStateChanged
(vstateh
) event to update videoState of participants in webapp client. When rejoining the call this callback is not really fired since video state of the other users does not really change (we're the one who's joining the call), so webapp was never informed again that some participants are sharing video/screen.The solution is to update video state of each participant whenever participant list changes - wCall.setParticipantChangedHandler(wUser, this.handleCallParticipantChanges). This callback gets fired if any state of call participant changes - whether it is audio establishment (
aestab
), video state (vrecv
) ormuted
. When joining a call user is informed of what is the current state of call participants. For more details see https://wearezeta.atlassian.net/wiki/spaces/ENGINEERIN/pages/616857724/Use+case+observe+call+participants