Bug 1671598 [wpt PR 26128] - [AspectRatio] Fix divide by zero with a small float...
[gecko.git] / dom / webidl / HTMLVideoElement.webidl
blob7512ad40f41e074b1eca05f1154203e20c8cc6c5
1 /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3  * License, v. 2.0. If a copy of the MPL was not distributed with this file,
4  * You can obtain one at http://mozilla.org/MPL/2.0/.
5  *
6  * The origin of this IDL file is
7  * http://www.whatwg.org/specs/web-apps/current-work/#the-video-element
8  *
9  * © Copyright 2004-2011 Apple Computer, Inc., Mozilla Foundation, and
10  * Opera Software ASA. You are granted a license to use, reproduce
11  * and create derivative works of this document.
12  */
14 [Exposed=Window]
15 interface HTMLVideoElement : HTMLMediaElement {
16   [HTMLConstructor] constructor();
18   [CEReactions, SetterThrows]
19            attribute unsigned long width;
20   [CEReactions, SetterThrows]
21            attribute unsigned long height;
22   readonly attribute unsigned long videoWidth;
23   readonly attribute unsigned long videoHeight;
24   [CEReactions, SetterThrows]
25            attribute DOMString poster;
28 partial interface HTMLVideoElement {
29   // A count of the number of video frames that have demuxed from the media
30   // resource. If we were playing perfectly, we'd be able to paint this many
31   // frames.
32   readonly attribute unsigned long mozParsedFrames;
34   // A count of the number of frames that have been decoded. We may drop
35   // frames if the decode is taking too much time.
36   readonly attribute unsigned long mozDecodedFrames;
38   // A count of the number of frames that have been presented to the rendering
39   // pipeline. We may drop frames if they arrive late at the renderer.
40   readonly attribute unsigned long mozPresentedFrames;
42   // Number of presented frames which were painted on screen.
43   readonly attribute unsigned long mozPaintedFrames;
45   // Time which the last painted video frame was late by, in seconds.
46   readonly attribute double mozFrameDelay;
48   // True if the video has an audio track available.
49   readonly attribute boolean mozHasAudio;
51   // Attributes for builtin video controls to lock screen orientation.
52   // True if video controls should lock orientation when fullscreen.
53   [Pref="media.videocontrols.lock-video-orientation", Func="IsChromeOrUAWidget"]
54     readonly attribute boolean mozOrientationLockEnabled;
55   // True if screen orientation is locked by video controls.
56   [Pref="media.videocontrols.lock-video-orientation", Func="IsChromeOrUAWidget"]
57     attribute boolean mozIsOrientationLocked;
59   // Clones the frames playing in this <video> to the target. Cloning ends
60   // when either node is removed from their DOM trees. Throws if one or
61   // both <video> elements are not attached to a DOM tree.
62   // Returns a promise that resolves when the target's ImageContainer has been
63   // installed in this <video>'s MediaDecoder, or selected video
64   // MediaStreamTrack, whichever is available first. Note that it might never
65   // resolve.
66   [Throws, Func="IsChromeOrUAWidget"]
67     Promise<void> cloneElementVisually(HTMLVideoElement target);
69   // Stops a <video> from cloning visually. Does nothing if the <video>
70   // wasn't cloning in the first place.
71   [Func="IsChromeOrUAWidget"]
72     void stopCloningElementVisually();
74   // Returns true if the <video> is being cloned visually to another
75   // <video> element (see cloneElementVisually).
76   [Func="IsChromeOrUAWidget"]
77     readonly attribute boolean isCloningElementVisually;
80 // https://dvcs.w3.org/hg/html-media/raw-file/default/media-source/media-source.html#idl-def-HTMLVideoElement
81 partial interface HTMLVideoElement {
82   [Pref="media.mediasource.enabled", NewObject]
83   VideoPlaybackQuality getVideoPlaybackQuality();