w3c / sdw

Repository for the Spatial Data on the Web Working Group
https://www.w3.org/2020/sdw/
148 stars 81 forks source link

WebVMT: Investigate optional endTime in HTML5 TextTrackCue interface #1106

Open rjksmith opened 5 years ago

rjksmith commented 5 years ago

WebVMT supports cues without end times for streamed media use cases, where the media end time may be unknown, e.g. during a live broadcast.

Map annotation which displays persistently is a common use case, but this is not currently addressed by TextTrackCue (or DataCue) interface in HTML5 which requires an endTime attribute.

There are two ways in which this could be addressed:

  1. Define a special value of TextTrackCue.endTime to signify that the time is unknown.
  2. Add a noEndTime flag to indicate that the cue persists indefinitely.

Currently, negative endTime values are allowed and signify cue times that occur before the start, according the note in TextTrackCue. One way of encoding an unknown time would be to set the endTime before the startTime for a cue, i.e. a negative cue duration. The HTML5 specification does not explicitly preclude this and it requires no change to the interface, but this may have unintended consequences for existing implementations.

Adding a boolean noEndTime flag provides a much clearer solution, but requires a change to the existing HTML5 TextTrackCue definition to include it.

I intend to investigate this issue as part of the planned Web Incubator CG activity, proposed at TPAC in Lyon.

rjksmith commented 5 years ago

Preliminary discussions for the proposed DataCue WICG activity have yielded an alternative solution. As HTML 5.2 already represents an unbounded stream using media.duration=Infinity, this idea could be extended to include TextTrackCue.endTime.

A suitable requirement has been included in the draft explainer for DataCue WICG.

rjksmith commented 4 years ago

Raised Pull Request for unbounded text track cue to propose change in whatwg: https://github.com/whatwg/html/pull/5953