This page is Ready to Use

Notice: The WebPlatform project, supported by various stewards between 2012 and 2015, has been discontinued. This site is now available on github.

addCue

Summary

Adds the given cue to textTrack’s text track list of cues.

Method of apis/audio-video/TextTrackapis/audio-video/TextTrack

Syntax

var  = TextTrack.addCue(cue);

Parameters

cue

Data-type
String

“cue” is of type TextTrackCue.

Return Value

Returns an object of type

Examples

using addCue in javascript and setting several properties:

myTextTrack = myPlayer.addTextTrack( 'subtitles','myLabel','en' );
var cue0 = new TextTrackCue(516.517,531.532, 'it had become much easier after the so called united resistance movement');
cue0.id = 'cue0';
cue0.pauseOnExit = false;
myTextTrack.addCue(cue0);

myTextTrack.mode = "showing";

This addCue does NOT work, but should. Several things go wrong. First of all, it does not recognize the percent sign. Secondly, the cue text is an html symbol, which is not interpreted as html.

var cue1 = new TextTrackCue(3.300,13.130, '&8594;');
cue1.id = 'cue1';
myTextTrack.addCue(cue1);
cue1.line = '50%';
cue1.position = '25%';

Related specifications

W3C HTML5 Specification
W3C Editor’s Draft

Attributions