Regression: No audio when call comes from Skype/IP phone #24602
Merged
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.
Proposed changes (including videos or screenshots)
The audio was not rendered because of re-rendering of react element based on
queueCounter and roomInfo. queueCounter and roomInfo cause the dom to re-render when call gets accepted
because after accepting call, queueCounter changes or a room gets created.
The audio element gets recreated. But VoIP user probably holds the old one.
The behaviour is not predictable when such case happens. If everything gets cleanly setup,
even if the audio element goes headless, it still continues to play the remote audio.
But in other cases, it is unreferenced the one on dom has its srcObject as null.
This causes no audio.
This fix provides a way to re-initialise the rendering elements in VoIP user
and calls this function on useEffect() if the re-render has happen.
Issue(s)
https://app.clickup.com/t/22hy1k4
Steps to test or reproduce
The issue is not consistently reproduced. Usually it is difficult to reproduce on local setup. It does not happen on Safari if the browser is refreshed for every call. But the reproducibility is > 40%.
Further comments
This reloading of DOM happens for room creation as well. But the problem is not that significant.