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: 155Edge
✕Not supportedup to 154
Current: 154Firefox
1–30Not supported
31+Supportedsince Jul 22, 2014
Current: 157Safari
1–14Not supported
14.1+Supportedsince Apr 26, 2021
Current: 27MobileChrome Android
✕Not supportedup to 155
Current: 155Firefox Android
4–30Not supported
31+Supportedsince Jul 22, 2014
Current: 157Safari iOS
1–14Not supported
14.5+Supportedsince Apr 26, 2021
Current: 27How 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
}Documentation (MDN)
Sub-features
Support for each part of the feature (2). The overall table above shows when the whole feature works.
| Sub-feature | Chrome | Edge | Firefox | Safari | Chrome Android | Firefox Android | Safari iOS |
|---|---|---|---|---|---|---|---|
| VTTCue.lineAlign | ✕ | ✕ | 31 | 14.1 | ✕ | 31 | 14.5 |
| VTTCue.positionAlign | ✕ | ✕ | 31 | 14.1 | ✕ | 31 | 14.5 |