1. 開発者向けのウェブ技術
  2. Web API
  3. TextTrackCueList
  4. length

このページはコミュニティーの尽力で英語から翻訳されました。MDN Web Docs コミュニティーについてもっと知り、仲間になるにはこちらから。

View in English Always switch to English

TextTrackCueList: length プロパティ

Baseline Widely available

This feature is well established and works across many devices and browser versions. It’s been available across browsers since ⁨2015年7月⁩.

lengthTextTrackCueList インターフェイスの読み取り専用プロパティで、リスト中のキューの数を返します。

unsigned long で、リスト中のキューの数を返します。

TextTrack.cues プロパティは、特定のトラックの現在のキューを格納した TextTrackCueList を返します。下記の WebVTT トラックを使用すると、length の値は 5 になります。

WEBVTT
first
00:00:00.000 --> 00:00:00.999 line:80%
Hildy!
second
00:00:01.000 --> 00:00:01.499 line:80%
How are you?
third
00:00:01.500 --> 00:00:02.999 line:80%
Tell me, is the ruler of the universe in?
fourth
00:00:03.000 --> 00:00:04.299 line:80%
Yes, they're in - in a bad humor
fifth
00:00:04.300 --> 00:00:06.000 line:80%
Somebody must've stolen the crown jewels
js
const video = document.getElementById("video");
video.onplay = () => {
 console.log(video.textTracks[0].cues.length); // 5
};

仕様書

Specification
HTML
# dom-texttrackcuelist-length

ブラウザーの互換性

Help improve MDN

Learn how to contribute

This page was last modified on by MDN contributors.

AltStyle によって変換されたページ (->オリジナル) /