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/.
6 * The origin of this IDL file is
7 * http://www.whatwg.org/specs/web-apps/current-work/#the-video-element
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.
15 InstrumentedProps=(cancelVideoFrameCallback,
16 onenterpictureinpicture,
17 onleavepictureinpicture,
19 requestPictureInPicture,
20 requestVideoFrameCallback)]
21 interface HTMLVideoElement : HTMLMediaElement {
22 [HTMLConstructor] constructor();
24 [CEReactions, SetterThrows]
25 attribute unsigned long width;
26 [CEReactions, SetterThrows]
27 attribute unsigned long height;
28 readonly attribute unsigned long videoWidth;
29 readonly attribute unsigned long videoHeight;
30 [CEReactions, SetterThrows]
31 attribute DOMString poster;
34 partial interface HTMLVideoElement {
35 // A count of the number of video frames that have demuxed from the media
36 // resource. If we were playing perfectly, we'd be able to paint this many
38 readonly attribute unsigned long mozParsedFrames;
40 // A count of the number of frames that have been decoded. We may drop
41 // frames if the decode is taking too much time.
42 readonly attribute unsigned long mozDecodedFrames;
44 // A count of the number of frames that have been presented to the rendering
45 // pipeline. We may drop frames if they arrive late at the renderer.
46 readonly attribute unsigned long mozPresentedFrames;
48 // Number of presented frames which were painted on screen.
49 readonly attribute unsigned long mozPaintedFrames;
51 // Time which the last painted video frame was late by, in seconds.
52 readonly attribute double mozFrameDelay;
54 // True if the video has an audio track available.
55 readonly attribute boolean mozHasAudio;
57 // Clones the frames playing in this <video> to the target. Cloning ends
58 // when either node is removed from their DOM trees. Throws if one or
59 // both <video> elements are not attached to a DOM tree.
60 // Returns a promise that resolves when the target's ImageContainer has been
61 // installed in this <video>'s MediaDecoder, or selected video
62 // MediaStreamTrack, whichever is available first. Note that it might never
64 [NewObject, Func="IsChromeOrUAWidget"]
65 Promise<undefined> cloneElementVisually(HTMLVideoElement target);
67 // Stops a <video> from cloning visually. Does nothing if the <video>
68 // wasn't cloning in the first place.
69 [Func="IsChromeOrUAWidget"]
70 undefined stopCloningElementVisually();
72 // Returns true if the <video> is being cloned visually to another
73 // <video> element (see cloneElementVisually).
74 [Func="IsChromeOrUAWidget"]
75 readonly attribute boolean isCloningElementVisually;
78 // https://dvcs.w3.org/hg/html-media/raw-file/default/media-source/media-source.html#idl-def-HTMLVideoElement
79 partial interface HTMLVideoElement {
80 [Pref="media.mediasource.enabled", NewObject]
81 VideoPlaybackQuality getVideoPlaybackQuality();
84 // https://w3c.github.io/picture-in-picture/#htmlvideoelement-extensions
85 partial interface HTMLVideoElement {
86 [CEReactions, SetterThrows] attribute boolean disablePictureInPicture;