构造函数
VTTRegion()-
返回新创建的
VTTRegion对象。
实例属性
VTTRegion.id-
用于标识该区域的字符串。
VTTRegion.width-
表示区域的宽度,占视频宽度的百分比。
VTTRegion.lines-
表示区域的高度,以行数表示。
VTTRegion.regionAnchorX-
表示区域锚点 X 偏移量,占区域宽度的百分比。
VTTRegion.regionAnchorY-
表示区域锚点 Y 偏移量,占区域高度的百分比。
VTTRegion.viewportAnchorX-
表示视口锚点 X 偏移量,占视频宽度的百分比。
VTTRegion.viewportAnchorY-
表示视口锚点 Y 偏移量,占视频高度的百分比。
VTTRegion.scroll-
一个枚举值,表示添加新 cue 时现有 cue 的移动方式。
示例
js
const region = new VTTRegion();
region.width = 50; // Use 50% of the video width
region.lines = 4; // Use 4 lines of height.
region.viewportAnchorX = 25; // Have the region start at 25% from the left.
const cue = new VTTCue(2, 3, "Cool text to be displayed");
cue.region = region; // This cue will be drawn only within this region.
规范
| 规范 |
|---|
| WebVTT:网页视频文本轨道格式 # the-vttregion-interface |
浏览器兼容性
加载中…