Only process mute events if a timer fired to avoid video flashing. #2147
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.
In the last couple of days I happened to have a crappy network as my ISP is having troubles, so I tried to better study the video flashing issue described in #2145.
By printing the time passed between
mute
andunmute
events raised by Chrome and plotting them into a graph, I found out that this is always a multiple of 834 ms:I have no idea where this value comes from, but it's important to take it into account when setting the timeout @SchoolCoder suggested. I rounded that value to 840 ms and set the timeout to three times that value (~2.5 seconds) which seems acceptable to me. This made most video flashing disappear in my crappy network.
I suck pretty bad at JavaScript, but it seemed easy enough to arrange a Pull Request.
Fixes #2145.