
The spec for loading a media element is quite huge. This implements just enough to parse the attribute, fetch the corresponding media object, and decode the media object (if it is a video). While doing so, this also implements most network state tracking and firing DOM events that may be observed via JavaScript.
33 lines
910 B
Text
33 lines
910 B
Text
#import <HTML/HTMLElement.idl>
|
|
#import <HTML/VideoTrackList.idl>
|
|
|
|
enum CanPlayTypeResult {
|
|
"",
|
|
"maybe",
|
|
"probably"
|
|
};
|
|
|
|
// https://html.spec.whatwg.org/multipage/media.html#htmlmediaelement
|
|
[Exposed=Window]
|
|
interface HTMLMediaElement : HTMLElement {
|
|
|
|
// network state
|
|
[Reflect, CEReactions] attribute DOMString src;
|
|
const unsigned short NETWORK_EMPTY = 0;
|
|
const unsigned short NETWORK_IDLE = 1;
|
|
const unsigned short NETWORK_LOADING = 2;
|
|
const unsigned short NETWORK_NO_SOURCE = 3;
|
|
readonly attribute unsigned short networkState;
|
|
|
|
[Reflect, CEReactions] attribute boolean autoplay;
|
|
[Reflect, CEReactions] attribute boolean loop;
|
|
|
|
[Reflect, CEReactions] attribute boolean controls;
|
|
|
|
CanPlayTypeResult canPlayType(DOMString type);
|
|
undefined load();
|
|
undefined pause();
|
|
|
|
// tracks
|
|
[SameObject] readonly attribute VideoTrackList videoTracks;
|
|
};
|