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

HTMLMediaElement.duration свойство возвращает длину медиа в секундах или ноль, если данные по медиа недоступны.

+ +

Синтаксис

+ +
var myDuration = audioOrVideo.duration
+ +

Значения

+ +

Double. Если медиа данные доступны, но длина неизвестна, то duration будет NaN. Если медиа загружается в фоновом режиме и не имеет заранее определенной длины, значение равно Inf.

+ +

Пример

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

Specifications

+ + + + + + + + + + + + + + + + + + + +
SpecificationStatusComment
{{SpecName('HTML WHATWG', "#dom-media-duration", "HTMLMediaElement.duration")}}{{Spec2('HTML WHATWG')}} 
{{SpecName('HTML5 W3C', "embedded-content-0.html#htmlmediaelement", "HTMLMediaElement.duration")}}{{Spec2('HTML5 W3C')}}Initial definition.
+ +

Browser compatibility

+ + + +

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

+ +

Смотрите также

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