建構函式
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 |
瀏覽器相容性
載入中…