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

Setting video.currentTime (seeking) should synchronously update the attribute's value #4477

Open
domenic opened this issue Mar 29, 2019 · 4 comments

Comments

@domenic
Copy link
Member

domenic commented Mar 29, 2019

By @foolip in https://www.w3.org/Bugs/Public/show_bug.cgi?id=28929:

There's a discrepancy between the spec and implementations that I think is unlikely to be resolved in favor of the spec.

https://html.spec.whatwg.org/#dom-media-seek returns early and the only effect that can be observed synchronously is that the seeking attribute is true.

I've tested Chromium, Firefox and IE, and all of them synchronously change the currentTime attribute:
http://software.hixie.ch/utilities/js/live-dom-viewer/saved/3562

I think the spec should do the same. Either by someone reusing "official playback position" for this purpose, or by introducing a separate "seek position" or similar.

The main problem with the spec as it is is that it makes it harder to write a good UI where seeking look like it has an immediate effect, even if currentTime may be slightly adjusted when the seek has actually finished.

@foolip
Copy link
Member

foolip commented Feb 24, 2022

I'm not sure if the spec changed, but it now does require currentTime to immediately start returning the new value. In https://html.spec.whatwg.org/#dom-media-currenttime says:

On setting, if the media element's readyState is HAVE_NOTHING, then it must set the media element's default playback start position to the new value; otherwise, it must set the official playback position to the new value and then seek to the new value.

The official playback position is what currentTime returns.

@foolip foolip closed this as completed Feb 24, 2022
@estobbart
Copy link

The currentTime value says it should be assigned to default playback start position when readyState is HAVE_NOTHING.

On setting, if the media element's readyState is HAVE_NOTHING, then it must set the media element's default playback start position to the new value

But the seeking definition makes no mention of the assignment.
4.8.11.9 step 2

If the media element's readyState is HAVE_NOTHING, return.

Can this be reopened to clarify those definitions?

@domenic
Copy link
Member Author

domenic commented Jun 10, 2022

I think I tried to fix the issue you're mentioning in #7638 but got confused by the review feedback and haven't made progress since. /cc @jernoble

It's also possible you're mentioning a different issue. I honestly am just pattern-matching at this point; I've lost all context on this stuff :(

@domenic domenic reopened this Jun 10, 2022
@estobbart
Copy link

estobbart commented Jun 10, 2022

The implementations I looked at seem to implement the seek definition, but the language is a bit confusing if you set currentTime to a position when readyState is HAVE_NOTHING, and its getter does not return that default playback start position value, without a change in the readyState.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

3 participants