68
red:89
...
The key here is to notice that the information is given in cues that span the length of time to which the relevant event applies. If, instead, the scores
were given as zero-length (or very brief, nearly zero-length) cues when the score changes, for example saying "red+2" at 05:11:17.198, "red+3" at
05:11:25.912, etc, problems arise: primarily, seeking is much harder to implement, as the script has to walk the entire list of cues to make sure that
no notifications have been missed; but also, if the cues are short it's possible the script will never see that they are active unless it listens to them
specifically.
When using cues in this manner, authors are encouraged to use thecuechangep384
event to update the current annotations. (In particular, using
thetimeupdatep384
event would be less appropriate as it would require doing work even when the cues haven't changed, and, more importantly,
would introduce a higher latency between when the metadata cues become active and when the display is updated, sincetimeupdatep384
events
are rate-limited.)
4.8.12.12 User interface
Thecontrolsattribute is aboolean attributep65
. If present, it indicates that the author has not provided a scripted controller and would like the user
agent to provide its own set of controls.
If the attribute is present, or ifscripting is disabledp827
for themedia elementp333
, then the user agent shouldexpose a user interface to the user.
This user interface should include features to begin playback, pause playback, seek to an arbitrary position in the content (if the content supports
arbitrary seeking), change the volume, change the display of closed captions or embedded sign-language tracks, select different audio tracks or
turn on audio descriptions, and show the media content in manners more suitable to the user (e.g. fullscreen video or in an independent resizable
window). Other controls may also be made available.
Even when the attribute is absent, however, user agents may provide controls to affect playback of the media resource (e.g. play, pause, seeking,
track selection, and volume controls), but such features should not interfere with the page's normal rendering. For example, such features could be
exposed in themedia elementp333
's context menu, platform media keys, or a remote control. The user agent may implement this simply byexposing
a user interface to the userp380
as described above (as if thecontrolsp380
attribute was present).
If the user agentexposes a user interface to the userp380
by displaying controls over themedia elementp333
, then the user agent should suppress
any user interaction events while the user agent is interacting with this interface. (For example, if the user clicks on a video's playback control,
mousedown
events and so forth would not simultaneously be fired at elements on the page.)
Where possible (specifically, for starting, stopping, pausing, and unpausing playback, for seeking, for changing the rate of playback, for fast-
forwarding or rewinding, for listing, enabling, and disabling text tracks, and for muting or changing the volume of the audio), user interface features
exposed by the user agent must be implemented in terms of the DOM API described above, so that, e.g., all the same events fire.
Features such as fast-forward or rewind must be implemented by only changing theplaybackRateattribute (and not the
defaultPlaybackRateattribute).
Seeking must be implemented in terms ofseekingp358
to the requested position in themedia elementp333
'smedia timelinep347
. For media resources
where seeking to an arbitrary position would be slow, user agents are encouraged to use theapproximate-for-speedflag when seeking in response
to the user manipulating an approximate position interface such as a seek bar.
For the purposes of listing chapters in themedia resourcep334
, onlytext tracksp363
in themedia elementp333
'slist of text tracksp363
that are
showingp365
and whosetext track kindp364
ischaptersp364
should be used. Such tracks must be interpreted according to therules for constructing
the chapter tree from a text trackp376
. When seeking in response to a user manipulating a chapter selection interface, user agents should not use
theapproximate-for-speedflag.
ThecontrolsIDL attribute mustreflectp89
the content attribute of the same name.
media.volumep381 [ =value]
Returns the current playback volume, as a number in the range 0.0 to 1.0, where 0.0 is the quietest and 1.0 the loudest.
Can be set, to change the volume.
Note
380