VTTCue: line property

Baseline Widely available

This feature is well established and works across many devices and browser versions. It’s been available across browsers since January 2020.

Thuộc tính line của giao diện VTTCue đại diện cho dòng cue của WebVTT cue này.

Giá trị

Một số, hoặc "auto" đại diện cho dòng cue của WebVTT cue này.

Ví dụ

Trong ví dụ sau, một VTTCue mới được tạo, sau đó giá trị của line được đặt thành 1. Giá trị sau đó được in ra console.

js
let video = document.querySelector("video");
let track = video.addTextTrack("captions", "Captions", "en");
track.mode = "showing";

let cue = new VTTCue(0, 0.9, "Hildy!");
cue.line = "1";
console.log(cue.line);

track.addCue(cue);

Thông số kỹ thuật

Thông số kỹ thuật
WebVTT: The Web Video Text Tracks Format
# dom-vttcue-line

Tương thích trình duyệt