HTMLオーディオ/ビデオDOMcurrentTimeプロパティ
例
時間位置を5秒に設定します。
var vid = document.getElementById("myVideo");
vid.currentTime = 5;
定義と使用法
currentTimeプロパティは、オーディオ/ビデオ再生の現在の位置(秒単位)を設定または返します。
このプロパティを設定すると、再生は指定された位置にジャンプします。
ブラウザのサポート
表の数字は、プロパティを完全にサポートする最初のブラウザバージョンを示しています。
Property | |||||
---|---|---|---|---|---|
currentTime | Yes | 9.0 | 3.5 | Yes | Yes |
構文
currentTimeプロパティを返します。
audio|video.currentTime
currentTimeプロパティを設定します。
audio|video.currentTime="seconds"
プロパティ値
Value | Description |
---|---|
seconds | Indicates the position for the playback of the audio/video, in seconds |
技術的な詳細
戻り値: | 現在の再生時間を秒単位で表す数値。 |
---|
❮HTMLオーディオ/ビデオDOMリファレンス