Text track cue event timing accuracy #5306
Labels
clarification
Standard could be clearer
editorial
Changes that do not affect how the standard is understood.
topic: media
The timing accuracy of
TextTrackCue
enter
andexit
events, andTextTrack
cuechange
events, with respect to the media timeline, is important for applications that render web content that is intended to be synchronised to audio or video media playback in some way.An example use case (from here): a subtitle or caption author wants ensure that subtitle changes are aligned as closely as possible to shot changes in the video. At a typical frame rate of 25 frames per second, this is 40 milliseconds per frame, and so the web app would need to receive the cue enter or exit event within 20 milliseconds to be able to respond and render in time.
In practice we see some variation between user agents in how often the time marches on steps are run. For example, in Chromium, the steps are run at the lowest rate specified for
timeupdate
, i.e., at most every 250 milliseconds during media playback. As a consequence, web apps that need greater timing accuracy must run a timer or rAF loop and poll the media element’scurrentTime
, which is power intensive. (Implementation work is now in progress to improve the timing accuracy in Chromium.)Proposals
Add a note indicating timing expectation
To clarify expectations for content authors, and to help implementation consistency, we would like to add a (non-normative) note before the time marches on steps, after the paragraph that begins “When the current playback position of a media element changes”:
Clarify wording relating to missed cues
The spec also says:
My understanding of the time marches on steps is that it guarantees that the
enter
andexit
events of cues that have been skipped between successive execution of time marches on will be fired (this is described in the steps involving missed cues, so the above only applies toactiveCues
during acuechange
event. So I would like to propose this change:I’d be happy to draft a pull request for review if there’s implementer interest.
Raising this issue following discussion in a breakout session at TPAC 2019.
cc @foolip @nigelmegitt
The text was updated successfully, but these errors were encountered: