HTMLMediaElement: seekable プロパティ

Baseline Widely available

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

seekableHTMLMediaElement オブジェクトの読み取り専用プロパティで、新しい静的な正規化された TimeRanges オブジェクトを返します。これは seekable プロパティがアクセスされた時点でユーザーエージェントがシーク可能なメディアリソースがあれば、その範囲を表します。

新しい静的な正規化された TimeRanges オブジェクトを返します。これは seekable プロパティがアクセスされた時点でユーザーエージェントがシーク可能なメディアリソースがあれば、その範囲を表します。

js
const video = document.querySelector("video");
const timeRangesObject = video.seekable;
const timeRanges = [];
// オブジェクトを走査し、配列へ出力
for (let count = 0; count < timeRangesObject.length; count++) {
  timeRanges.push([timeRangesObject.start(count), timeRangesObject.end(count)]);
}

仕様書

Specification
HTML
# dom-media-seekable-dev
Media Source Extensions™
# htmlmediaelement-extensions-seekable

ブラウザーの互換性

Report problems with this compatibility data on GitHub
desktopmobile
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
seekable

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support

関連情報