Make media.currentTime more accurate during seeking #7638
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Previously, currentTime always returned the "official playback position", which is only periodically synced with the "current playback position". In particular, if JavaScript code performs a seek (e.g. using the seek() method), this would not sync them until a stable state is reached. (I.e., until that JavaScript code runs to completion.)
This shows up particularly in the case where currentTime is set to a value outside of the timeline, e.g. Number.MAX_VALUE. The previous spec would cause whatever is passed to the currentTime setter, to then be returned by the currentTime getter. But Chromium and Gecko instead clamped the result to the timeline. Chromium's implementation of this, in particular, is to return the current playback position during the seek process, which is what we have specified here.
See web-platform-tests/wpt#32832 for more discussion.
(See WHATWG Working Mode: Changes for more details.)
/media.html ( diff )