A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://developer.mozilla.org/ja/docs/Web/API/HTMLMediaElement/currentTime below:

HTMLMediaElement: currentTime プãƒãƒ‘ティ - Web API

HTMLMediaElement: currentTime プロパティ

Baseline Widely available

HTMLMediaElement インターフェイスの currentTime プロパティは、現在の再生時間を秒単位で示します。

この値を変更すると、メディアは新しい時刻にシークされます。

値

現在の再生時刻を秒単位で示す倍精度浮動小数点値です。

メディアがまだ再生されていない場合、 currentTime の値は play() メソッドが呼ばれたときに再生が開始されるメディア内の時刻位置を示しています。

currentTimeに新しい値を設定すると、メディアが利用可能であれば、指定された時刻にシークします。

ライブストリーミングされたメディアなど、再生時間が不明なメディアでは、ブラウザーがメディアバッファーから時間切れのメディア部分を取得できない可能性があります。また、タイムラインが 0 秒で始まらないメディアは、そのタイムラインの最も早い時刻より前にシークすることはできません。

秒単位のメディアの長さは、 durationプロパティを用いて決定することができます。

例
const video = document.createElement("video");
console.log(video.currentTime);
使用上の注意 ## 時間精度の低下

タイミング攻撃やフィンガープリンティングから保護するために、video.currentTime の精度はブラウザー設定によっては丸められている可能性があります。Firefox では、privacy.reduceTimerPrecision 環境設定は既定で有効になっており、既定では 2ms になっています。privacy.resistFingerprinting を有効にすることもでき、その場合精度は 100ms または privacy.resistFingerprinting.reduceTimerPrecision.microseconds の値のどちらか大きい方になります。

例えば、時刻精度が低下した場合、video.currentTime の結果は常に 0.002 の倍数になり、privacy.resistFingerprinting が有効な場合は 0.1 の倍数(または privacy.resistFingerprinting.reduceTimerPrecision.microseconds)になります。

// Firefox 60 における 時間制度の低下 (2ms)
video.currentTime;
// Might be:
// 23.404
// 24.192
// 25.514
// …

// `privacy.resistFingerprinting` が有効な場合の時間制度の低下
video.currentTime;
// Might be:
// 49.8
// 50.6
// 51.7
// …
仕様書 ブラウザーの互換性 関連情報

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4