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 the currentTime setter clamp to duration #9742

Open
foolip opened this issue Sep 15, 2023 · 2 comments
Open

Make the currentTime setter clamp to duration #9742

foolip opened this issue Sep 15, 2023 · 2 comments
Labels
interop Implementations are not interoperable with each other topic: media

Comments

@foolip
Copy link
Member

foolip commented Sep 15, 2023

In web-platform-tests/wpt#32832 @muan has reported an interop issue between browsers when setting video.currentTime to a value larger than video.duration. I haven't tested and verified today, but I believe Chrome and Firefox clamp it to the duration, while Safari returns back the set value. I'm not sure exactly when Safari clamps and starts returning the clamped value.

Safari matches the current spec as far as I can tell, because the currentTime setter updates the official playback positions and then seeks.

However, it seems like a relatively small change to the spec is possible that would allow browsers to align here.

The seeking algorithm already determines a new playback position synchronously, but it is not observable to script synchronously. We could set the official playback position in this algorithm, and not set it in the currentTime setter.

I have one doubt, which is that per the current spec, an implementation could arrange for currentTime to start returning the new value right before the seeking event is fired, guaranteeing that the change isn't seen before then. If Safari actually does that, then I think my proposal isn't as good.

cc @whatwg/media

@foolip
Copy link
Member Author

foolip commented Sep 15, 2023

@eric-carlson your feedback on the Safari behavior would be great here. (Also, long time no GitHub, hope you're doing well!)

@muan
Copy link
Member

muan commented Sep 15, 2023

I have also brought this up to @eric-carlson in person at TPAC and got some clarification hence my follow-up comment in WPT. I think what you summarized here is essentially my takeaway. But interop issue remains so thank you @foolip for opening this!

@keithamus keithamus added the interop Implementations are not interoperable with each other label Sep 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
interop Implementations are not interoperable with each other topic: media
Development

No branches or pull requests

4 participants
@keithamus @foolip @muan and others