<overlay> is a proposal to display and style subtitles/captions for <video> in a uniform way, regardless of whether they are in-band or from an external resource. It also doubles as a container to overlay arbitrary (HTML) content on a <video>, enabling advanced scripted overlays such as karaoke animations or visual annotations.
Use Case Description
There are several distinct use cases addressed by this proposal:
- Linking < with external captions/subtitles for native fetching/decoding/display by the UA.
- Styling captions/subtitles with CSS, regardless of their source.
- Allowing scripts to operate on captions/subtitles in a uniform manner, regardless of their source.
Possible sources of captions/subtitles include in-band (e.g. embedded in an MPEG-4 or Ogg stream), external (e.g. SRT or DXFP) or scripted (e.g. extracted from an on-page transcript) captions/subtitles.
HTML5 currently lacks convenient markup and/or interfaces to handle at least these things:
- Syncing and styling external subtitles/captions with <video>
- Styling in-band subtitles/captions from media resources
- Rendering scripted controls on top of <video> and positioning them to bottom.
- Callbacks at specific times for scripted subtitles/captions (previously possible with "cue ranges")
- Allowing any overlay (controls/captions/etc) to be retained in fullscreen mode.
Current Usage and Workarounds
Currently no browser supports rendering in-band subtitles, so there are no workarounds for styling them. Fullscreen support is still immature, but there is no possible workaround for having scripted captions or controls to appear in fullscreen display.
In order to overlay scripted controls on top of <video>, a wrapping <div> and some CSS is needed:
<div style="position:relative;width:400px;height:300px"> <video src="video.ogv" style="width:100%;height:100%"></video> <div class="controls" style="position:absolute;bottom:0;left:0;right:0"> <!-- actual controls here --> </div> </div>
This isn't terrible, but requires the size of the video to be known or be fixed to a certain size as above.
Explanation of how and why new markup would be useful.
Requests for this Feature
- <overlay> Suggested by Philip Jägenstedt (Opera)
TODO: Find the many mails related to some of the features addressed by <overlay>
- Brief description of the solution and of how it address the problem at hand.
- Explanation of the changes introduced by this solution. It explains how the document is processed, and how errors are handled. This should be very clear, including things such as event timing if the solution involves events, how to create graphs representing the data in the case of semantic proposals, etc.
- Cases not covered by this solution in relation to the problem description; other problems with this solution, if any.
- Description of how and why browser vendors would take advantage of this feature.
- Reasons why page authors would use this solution.
Silvia Pfeiffer's blog posts:
- More video accessibility work
- First experiments with itext
- The different aspects of video accessibility
- New proposal for captions and other timed text for HTML5
- The model of a time-linear media resource for HTML5
- Manifests for exposing the structure of a Composite Media Resource
Silvia Pfeiffer's <itext> proposals: