-
-
Notifications
You must be signed in to change notification settings - Fork 585
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix exceptions where HTMLMediaElement loads and plays race #185
Conversation
* Lookup from opaque queue ID to a promise for media element operations that | ||
* need to be serialised into a given queue | ||
*/ | ||
MatrixCall.mediaPromises = {}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are you attaching this to the prototype rather than being an instance member of the MatrixCall
like the other fields are?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, we're using this as a dictionary where an external entity (the caller) can set arbitrary keys. We should make this a proper map then using Object.create(null)
(an object without a prototype) else you can get fun bugs if people decide to use "hasOwnProperty" as a queue ID. It's unlikely to happen in this particular case, but given it's a direct replacement and everything else remains the same, it's trivial to do.
LGTM aside from comments. |
LGTM |
ironically there was a horrific bug here; by discarding failed promises, the whole promise chain will break forever if a play() fails. Turns out this is quite common, as things like unmounting the Hopefully this is fixed now and so going to merge (with a bunch of debugging in case of future problems) |
No description provided.