diff options
author | Josh Matthews <josh@joshmatthews.net> | 2015-11-07 00:43:17 -0500 |
---|---|---|
committer | Josh Matthews <josh@joshmatthews.net> | 2016-05-03 18:05:18 -0400 |
commit | 5960fbe6048e74e6be5708f8326ef23f2708810e (patch) | |
tree | ca3bc03438310e5e76432e887387f3aeeb76ca0c /components/script/dom/webidls | |
parent | eae27adc4af727699338b67f648cac85233679ce (diff) | |
download | servo-5960fbe6048e74e6be5708f8326ef23f2708810e.tar.gz servo-5960fbe6048e74e6be5708f8326ef23f2708810e.zip |
Implement load, canPlayType, and error APIs for media elements.
Diffstat (limited to 'components/script/dom/webidls')
-rw-r--r-- | components/script/dom/webidls/HTMLMediaElement.webidl | 8 | ||||
-rw-r--r-- | components/script/dom/webidls/MediaError.webidl | 14 |
2 files changed, 18 insertions, 4 deletions
diff --git a/components/script/dom/webidls/HTMLMediaElement.webidl b/components/script/dom/webidls/HTMLMediaElement.webidl index 5515618d6a9..30127ffec62 100644 --- a/components/script/dom/webidls/HTMLMediaElement.webidl +++ b/components/script/dom/webidls/HTMLMediaElement.webidl @@ -3,12 +3,12 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ // https://html.spec.whatwg.org/multipage/#htmlmediaelement -//enum CanPlayTypeResult { "" /* empty string */, "maybe", "probably" }; +enum CanPlayTypeResult { "" /* empty string */, "maybe", "probably" }; [Abstract] interface HTMLMediaElement : HTMLElement { // error state - //readonly attribute MediaError? error; + readonly attribute MediaError? error; // network state attribute DOMString src; @@ -21,8 +21,8 @@ interface HTMLMediaElement : HTMLElement { readonly attribute unsigned short networkState; // attribute DOMString preload; //readonly attribute TimeRanges buffered; - //void load(); - //CanPlayTypeResult canPlayType(DOMString type); + void load(); + CanPlayTypeResult canPlayType(DOMString type); // ready state const unsigned short HAVE_NOTHING = 0; diff --git a/components/script/dom/webidls/MediaError.webidl b/components/script/dom/webidls/MediaError.webidl new file mode 100644 index 00000000000..52210aa8c01 --- /dev/null +++ b/components/script/dom/webidls/MediaError.webidl @@ -0,0 +1,14 @@ +/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +// https://html.spec.whatwg.org/multipage/embedded-content.html#mediaerror + +interface MediaError { + const unsigned short MEDIA_ERR_ABORTED = 1; + const unsigned short MEDIA_ERR_NETWORK = 2; + const unsigned short MEDIA_ERR_DECODE = 3; + const unsigned short MEDIA_ERR_SRC_NOT_SUPPORTED = 4; + readonly attribute unsigned short code; +}; |