HTMLオーディオ/ビデオDOM再生プロパティ

❮HTMLオーディオ/ビデオDOMリファレンス

ビデオの最初に再生された範囲(一部)を数秒で取得します。

var vid = document.getElementById("myVideo");
alert("Start: " + vid.played.start(0) + " End: " + vid.played.end(0));

定義と使用法

playingプロパティはTimeRangesオブジェクトを返します。

TimeRangesオブジェクトは、ユーザーがすでに再生(表示)したオーディオ/ビデオの範囲を表します。

再生範囲は、再生されたオーディオ/ビデオの時間範囲です。ユーザーがオーディオ/ビデオをスキップすると、ユーザーはいくつかの再生範囲を取得します。

注:このプロパティは読み取り専用です。


ブラウザのサポート

表の数字は、プロパティを完全にサポートする最初のブラウザバージョンを示しています。

Property
played Yes 9.0 15.0 Yes Yes

構文

audio|video.played

戻り値

Type Description
TimeRanges Object Represents the played parts of the audio/video.

TimeRanges Object Properties:

  • length - get the number of played ranges in the audio/video
  • start(index) - get the start position of a played range
  • end(index) - get the end position of a played range

Note: The first played range is index 0


❮HTMLオーディオ/ビデオDOMリファレンス