VTTCue: size 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 size của giao diện VTTCue đại diện cho kích thước của cue theo phần trăm kích thước video.

Giá trị

Một số đại diện cho kích thước của cue theo phần trăm kích thước video.

Ví dụ

Trong ví dụ sau, một VTTCue mới được tạo, sau đó giá trị của size được đặt thành 50. 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.size = 50;
console.log(cue.size);

track.addCue(cue);

Thông số kỹ thuật

Specification
WebVTT: The Web Video Text Tracks Format
# dom-vttcue-size

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