From 33058f2b292b3a581333bdfb21b8f671898c5060 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 14:40:17 -0500 Subject: initial commit --- .../web/api/htmlmediaelement/duration/index.html | 62 ++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 files/ja/web/api/htmlmediaelement/duration/index.html (limited to 'files/ja/web/api/htmlmediaelement/duration') diff --git a/files/ja/web/api/htmlmediaelement/duration/index.html b/files/ja/web/api/htmlmediaelement/duration/index.html new file mode 100644 index 0000000000..9ad490c6c2 --- /dev/null +++ b/files/ja/web/api/htmlmediaelement/duration/index.html @@ -0,0 +1,62 @@ +--- +title: HTMLMediaElement.duration +slug: Web/API/HTMLMediaElement/duration +tags: + - API + - HTML DOM + - HTMLMediaElement + - Property + - Web +translation_of: Web/API/HTMLMediaElement/duration +--- +
{{APIRef("HTML DOM")}}
+ +

HTMLMediaElement.duration プロパティは、メディアの長さを秒単位で示します。 使用可能なメディアデータがない場合はゼロになります。

+ +

構文

+ +
var myDuration = audioOrVideo.duration
+ +

+ +

double 型。 メディアデータは利用可能だが長さが不明な場合、この値は NaN です。 メディアがストリーミングされ、事前定義された長さを持たない場合、値は Inf です。

+ +

+ +
var obj = document.createElement('video');
+console.log(obj.duration); // NaN
+
+ +

仕様

+ + + + + + + + + + + + + + + + + + + +
仕様状態コメント
{{SpecName('HTML WHATWG', "#dom-media-duration", "HTMLMediaElement.duration")}}{{Spec2('HTML WHATWG')}} 
{{SpecName('HTML5 W3C', "embedded-content-0.html#htmlmediaelement", "HTMLMediaElement.duration")}}{{Spec2('HTML5 W3C')}}初期定義
+ +

ブラウザーの互換性

+ + + +

{{Compat("api.HTMLMediaElement.duration")}}

+ +

関連情報

+ + -- cgit v1.2.3-54-g00ecf