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.

align

Summary

A string representing the text track cue alignment, as follows. If it is start alignment: the string "start". If it is middle alignment: the string "middle". If it is end alignment: the string "end". If it is left alignment: the string "left". If it is right alignment: the string "right". Default is "middle".

Property of apis/audio-video/TextTrackCueapis/audio-video/TextTrackCue

Syntax

var result = TextTrackCue.align;
TextTrackCue.align = value;

Return Value

Returns an object of type StringString

Examples

//. . .
var myTrack = document.getElementById("entrack").track; // get text track from track element
var myCues = myTrack.cues;   // get list of cues
for (var i = 0; i < myCues.length; i++) {
// set all cue alignments
myCues[i].align = "left");
}
//. . .

Related specifications

W3C HTML5 Specification
W3C Editor’s Draft

Attributions