coderef

WebVTT cue alignmentLimited availability

The WebVTT cue alignment settings control which part of the cue is aligned with the given line and position. Cue alignment is set using line and position settings in WebVTT files or the lineAlign and positionAlign properties of VTTCue using JavaScript.

Not yet supported in all major browsers — check the table and provide a fallback.

Browser support

DesktopChrome
✕Not supportedup to 155
Current: 155
Edge
✕Not supportedup to 154
Current: 154
Firefox
1–30Not supported
31+Supportedsince Jul 22, 2014
Current: 157
Safari
1–14Not supported
14.1+Supportedsince Apr 26, 2021
Current: 27
MobileChrome Android
✕Not supportedup to 155
Current: 155
Firefox Android
4–30Not supported
31+Supportedsince Jul 22, 2014
Current: 157
Safari iOS
1–14Not supported
14.5+Supportedsince Apr 26, 2021
Current: 27

How to use

Not supported in Chrome, Edge, Chrome Android. Use feature detection below and provide a fallback (or a polyfill) for those browsers.

Example

Full syntax and examples are on MDN: lineAlign.

Feature detection

JS · check before using
if ("VTTCue" in globalThis && "lineAlign" in VTTCue.prototype) {
  // VTTCue.lineAlign is available
}

Sub-features

Support for each part of the feature (2). The overall table above shows when the whole feature works.

Sub-featureChromeEdgeFirefoxSafariChrome AndroidFirefox AndroidSafari iOS
VTTCue.lineAlign✕✕3114.1✕3114.5
VTTCue.positionAlign✕✕3114.1✕3114.5