VTTRegion: VTTRegion() constructor
Limited availability
This feature is not Baseline because it does not work in some of the most widely-used browsers.
Want more browser support for this feature? Tell us why.
The VTTRegion() constructor creates a new VTTRegion object instance.
Syntax
js
new VTTRegion()
Parameters
None.
Return value
A new VTTRegion object.
The properties of the returned object are initialized to the following values:
id:""(the empty string)width:100lines:3regionAnchorX:0regionAnchorY:100viewportAnchorX:0viewportAnchorY:100scroll:""(the empty string)
Examples
js
const region = new VTTRegion();
region.width = 50; // Use 50% of the video width
region.lines = 4; // Use 4 lines of height.
Specifications
| Specification |
|---|
| WebVTT: The Web Video Text Tracks Format> # dom-vttregion-vttregion> |