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

duration assignment to the MediaSource is unclear #230

Closed
estobbart opened this issue Feb 26, 2019 · 4 comments
Closed

duration assignment to the MediaSource is unclear #230

estobbart opened this issue Feb 26, 2019 · 4 comments

Comments

@estobbart
Copy link

@wolenetz It appears in Chrome when assigning duration to MediaSource that the buffer's updating is set to true without actually dispatching updatestart or the corresponding updateend. It makes sense that it would be updating, because the buffer may need to change it's range due to the newly assigned duration. But it's not well documented here, and the lack of events make it hard to track.

@jyavenard
Copy link
Member

Changing the mediasource's duration never remove data from the source buffer, as such, it can't change the buffered range.
Also, the spec is rather clear on the matter and there's no mention on having to set the updating attribute to true.
https://w3c.github.io/media-source/#duration-change-algorithm

As such, this is an issue that needs to be lodged against chrome issue tracking. not the spec.

@estobbart
Copy link
Author

Apologies.. it may not be specific to Chrome. So is it possible that the bounds of the buffer is beyond the duration and that a client adjusting the duration makes no changes to the underlying buffer? Or is it that any assignments my ultimately be ignored for whatever value is greater?

@jyavenard
Copy link
Member

if you set duration such that buffered data would be outside the duration of the element, then duration value will actually be set to the "highest end time".
The buffered range reflects the actual data found in the sourcebuffer.

it's all described in the link I provided earlier.

There's no rationale for setting the updating attribute to true simply because you set the duration. And TBH, I'd be extremely surprise if chrome did do that.
Setting the duration and updating attribute read are synchronous, so even if updating did get change to true internally and back to false when the duration change algorithm has completed it wouldn't be observable from the JS.

@estobbart
Copy link
Author

Thanks @jyavenard for clearing this up.

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

No branches or pull requests

2 participants