RESOLVED FIXED 229605
[Media] Make currentTime compliant with the spec when readyState is HAVE_NOTHING
https://bugs.webkit.org/show_bug.cgi?id=229605
Summary [Media] Make currentTime compliant with the spec when readyState is HAVE_NOTHING
Enrique Ocaña
Reported 2021-08-27 02:50:31 PDT
(From https://github.com/WebPlatformForEmbedded/WPEWebKit/issues/722) Setting the media element currentTime property when its readyState is HAVE_NOTHING, returns early with no action. According to the specification this should get/set an internal default playback position which should be used when the media is not in a ready state. From [https://html.spec.whatwg.org/#current-playback-position] > The currentTime attribute must, on getting, return the media element's default playback start position, > unless that is zero, in which case it must return the element's official playback position. The returned > value must be expressed in seconds. 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 new value must be > interpreted as being in seconds. The concept of "default playback position" has been around in the spec since October 2011 (https://web.archive.org/web/20111006043825/http://www.whatwg.org/specs/web-apps/current-work/multipage/the-video-element.html#default-playback-start-position), but the WebKit implementation isn't aware of it and just resorts to regular seeks in those cases.
Attachments
Patch (7.47 KB, patch)
2021-08-27 08:33 PDT, Enrique Ocaña
no flags
Patch (8.14 KB, patch)
2021-08-30 08:18 PDT, Enrique Ocaña
no flags
Patch (8.28 KB, patch)
2021-08-31 03:22 PDT, Enrique Ocaña
no flags
Patch (8.15 KB, patch)
2021-08-31 10:17 PDT, Enrique Ocaña
no flags
Patch (8.22 KB, patch)
2021-09-02 09:47 PDT, Enrique Ocaña
no flags
Enrique Ocaña
Comment 1 2021-08-27 08:33:47 PDT
Eric Carlson
Comment 2 2021-08-27 09:49:16 PDT
Comment on attachment 436629 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=436629&action=review > LayoutTests/media/video-seek-have-nothing.html:25 > + testExpected('video.currentTime', 2); > + It would be useful to check the time after playback starts as well, to test the changes to `HTMLMediaElement::setReadyState` > LayoutTests/media/video-seek-have-nothing.html:29 > + }, 1500); 1500ms is probably short enough that we will have false-positives on a heavily loaded bot, so I'd use something much larger (6000?)
Enrique Ocaña
Comment 3 2021-08-30 08:18:55 PDT
Enrique Ocaña
Comment 4 2021-08-31 03:22:40 PDT
Enrique Ocaña
Comment 5 2021-08-31 10:17:21 PDT
Enrique Ocaña
Comment 6 2021-09-01 10:17:35 PDT
Now only the Mac stress test bot fails. CurrentTime "goes back" to 0 after the seeked event. I guess it's because we reset defaultPlaybackStartPosition (so the "actual" 0 position is now into effect for currentTime), but the seekTask() enqueued internally by seekWithTolerance() takes time to run, so that temporary 0 is visible. However, the "seeked" event is only triggered after the seek has been completed, so I don't know why the seek target time isn't returned.
Enrique Ocaña
Comment 7 2021-09-02 09:47:16 PDT
Radar WebKit Bug Importer
Comment 8 2021-09-03 02:51:15 PDT
EWS
Comment 9 2021-11-10 03:36:12 PST
Committed r285571 (244079@main): <https://commits.webkit.org/244079@main> All reviewed patches have been landed. Closing bug and clearing flags on attachment 437161 [details].
Note You need to log in before you can comment on or make changes to this bug.