2023-06-12 14:52:30 -03:00
|
|
|
#import <HTML/AudioTrackList.idl>
|
2022-02-15 16:10:51 -03:00
|
|
|
#import <HTML/HTMLElement.idl>
|
2023-04-22 15:44:33 -03:00
|
|
|
#import <HTML/MediaError.idl>
|
2024-07-25 16:23:15 -03:00
|
|
|
#import <HTML/TextTrack.idl>
|
2024-07-05 16:24:41 -03:00
|
|
|
#import <HTML/TextTrackList.idl>
|
2023-04-18 17:22:34 -03:00
|
|
|
#import <HTML/TimeRanges.idl>
|
2023-04-04 15:14:33 -03:00
|
|
|
#import <HTML/VideoTrackList.idl>
|
2023-11-04 21:48:01 -03:00
|
|
|
#import <HTML/Scripting/Fetching.idl>
|
2026-03-26 04:06:18 -03:00
|
|
|
#import <MediaSourceExtensions/MediaSource.idl>
|
2022-02-15 16:10:51 -03:00
|
|
|
|
2024-08-12 10:07:15 -03:00
|
|
|
// https://html.spec.whatwg.org/multipage/media.html#attr-media-preload
|
|
|
|
|
[MissingValueDefault=metadata, InvalidValueDefault=metadata]
|
|
|
|
|
enum Preload {
|
|
|
|
|
"auto",
|
|
|
|
|
"none",
|
|
|
|
|
"metadata"
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// https://html.spec.whatwg.org/multipage/media.html#canplaytyperesult
|
2022-03-04 14:49:30 -03:00
|
|
|
enum CanPlayTypeResult {
|
|
|
|
|
"",
|
|
|
|
|
"maybe",
|
|
|
|
|
"probably"
|
|
|
|
|
};
|
|
|
|
|
|
2026-03-26 04:06:18 -03:00
|
|
|
typedef (MediaSource or Blob) MediaProvider;
|
|
|
|
|
|
2022-10-07 19:45:09 -03:00
|
|
|
// https://html.spec.whatwg.org/multipage/media.html#htmlmediaelement
|
2023-09-03 01:18:30 -03:00
|
|
|
[Exposed=Window]
|
2020-07-31 23:05:43 -03:00
|
|
|
interface HTMLMediaElement : HTMLElement {
|
|
|
|
|
|
2023-04-22 15:44:33 -03:00
|
|
|
// error state
|
|
|
|
|
readonly attribute MediaError? error;
|
|
|
|
|
|
2023-04-03 12:11:18 -03:00
|
|
|
// network state
|
2024-08-08 06:35:57 -03:00
|
|
|
[Reflect, CEReactions, URL] attribute USVString src;
|
2026-03-26 04:06:18 -03:00
|
|
|
attribute MediaProvider? srcObject;
|
2023-04-19 07:44:40 -03:00
|
|
|
readonly attribute USVString currentSrc;
|
2023-11-04 21:48:01 -03:00
|
|
|
[Reflect=crossorigin, CEReactions, Enumerated=CORSSettingsAttribute] attribute DOMString? crossOrigin;
|
2023-04-03 12:11:18 -03:00
|
|
|
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;
|
2024-08-12 10:07:15 -03:00
|
|
|
[Reflect, CEReactions, Enumerated=Preload] attribute DOMString preload;
|
2023-04-18 17:22:34 -03:00
|
|
|
readonly attribute TimeRanges buffered;
|
2023-04-04 16:12:40 -03:00
|
|
|
undefined load();
|
|
|
|
|
CanPlayTypeResult canPlayType(DOMString type);
|
2020-07-31 23:05:43 -03:00
|
|
|
|
2023-04-04 16:41:09 -03:00
|
|
|
// ready state
|
|
|
|
|
const unsigned short HAVE_NOTHING = 0;
|
|
|
|
|
const unsigned short HAVE_METADATA = 1;
|
|
|
|
|
const unsigned short HAVE_CURRENT_DATA = 2;
|
|
|
|
|
const unsigned short HAVE_FUTURE_DATA = 3;
|
|
|
|
|
const unsigned short HAVE_ENOUGH_DATA = 4;
|
|
|
|
|
readonly attribute unsigned short readyState;
|
2023-04-11 19:37:00 -03:00
|
|
|
readonly attribute boolean seeking;
|
2023-04-04 16:41:09 -03:00
|
|
|
|
2023-04-04 16:12:40 -03:00
|
|
|
// playback state
|
2023-04-10 11:07:23 -03:00
|
|
|
attribute double currentTime;
|
2023-04-23 17:17:01 -03:00
|
|
|
undefined fastSeek(double time);
|
2023-04-04 16:12:40 -03:00
|
|
|
readonly attribute unrestricted double duration;
|
2024-05-21 12:40:32 -03:00
|
|
|
[FIXME] object getStartDate();
|
2023-04-07 12:10:57 -03:00
|
|
|
readonly attribute boolean paused;
|
2025-02-08 21:42:50 -03:00
|
|
|
attribute double defaultPlaybackRate;
|
|
|
|
|
attribute double playbackRate;
|
2024-05-19 10:15:49 -03:00
|
|
|
[FIXME] attribute boolean preservesPitch;
|
2025-02-14 07:22:01 -03:00
|
|
|
readonly attribute TimeRanges played;
|
2025-02-14 07:22:12 -03:00
|
|
|
readonly attribute TimeRanges seekable;
|
2023-04-10 21:04:46 -03:00
|
|
|
readonly attribute boolean ended;
|
2023-02-28 22:45:18 -03:00
|
|
|
[Reflect, CEReactions] attribute boolean autoplay;
|
|
|
|
|
[Reflect, CEReactions] attribute boolean loop;
|
2023-04-07 13:52:41 -03:00
|
|
|
Promise<undefined> play();
|
2023-04-04 16:12:40 -03:00
|
|
|
undefined pause();
|
2020-11-09 05:15:10 -03:00
|
|
|
|
2023-04-04 16:12:40 -03:00
|
|
|
// controls
|
2023-02-28 22:45:18 -03:00
|
|
|
[Reflect, CEReactions] attribute boolean controls;
|
2023-06-14 14:07:09 -03:00
|
|
|
attribute double volume;
|
|
|
|
|
attribute boolean muted;
|
|
|
|
|
[Reflect=muted, CEReactions] attribute boolean defaultMuted;
|
2020-11-09 05:15:10 -03:00
|
|
|
|
2023-04-04 15:14:33 -03:00
|
|
|
// tracks
|
2023-06-12 14:52:30 -03:00
|
|
|
[SameObject] readonly attribute AudioTrackList audioTracks;
|
2023-04-04 15:14:33 -03:00
|
|
|
[SameObject] readonly attribute VideoTrackList videoTracks;
|
2024-07-05 16:24:41 -03:00
|
|
|
[SameObject] readonly attribute TextTrackList textTracks;
|
2024-07-25 16:23:15 -03:00
|
|
|
TextTrack addTextTrack(TextTrackKind kind, optional DOMString label = "", optional DOMString language = "");
|
2023-10-25 12:26:24 -03:00
|
|
|
|
2020-12-09 18:26:42 -03:00
|
|
|
};
|