Skip to content
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

Make MainSourceBufferInterface code more readable isolating inner functions #1569

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from

Conversation

peaBerberian
Copy link
Collaborator

Note: this was part of the #1413 PR, which was a collection of unrelated improvements. I Chose to open individual pull requests instead so it's easier to review and discuss.


The callback called on the "updateend" and "error" events on a SourceBuffer were previously declared as arrow functions inside the constructor.

This allowed to keep a clear JS context for the this keyword, but it made the MainSourceBufferInterface's constructor harder to read.

I found it more readable to declare both callback as private methods instead, with the drawback of having to bind the this explictely.

…ctions

The callback called on the `"updateend"` and `"error"` events on a
SourceBuffer were previously declared as arrow functions inside the
constructor.

This allowed to keep a clear JS context for the `this` keyword, but it
made the `MainSourceBufferInterface`'s constructor harder to read.

I found it more readable to declare both callback as private methods
instead, with the drawback of having to bind the `this` explictely.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant