OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2007, 2010, 2011, 2012 Apple Inc. All rights reserved. | 2 * Copyright (C) 2007, 2010, 2011, 2012 Apple Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
11 * documentation and/or other materials provided with the distribution. | 11 * documentation and/or other materials provided with the distribution. |
12 * | 12 * |
13 * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY | 13 * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY |
14 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | 14 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
15 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | 15 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR |
16 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR | 16 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR |
17 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, | 17 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, |
18 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, | 18 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, |
19 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR | 19 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR |
20 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY | 20 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY |
21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
24 */ | 24 */ |
25 | 25 |
26 [ | 26 [ |
27 EnabledAtRuntime=Media, | 27 RuntimeEnabled=Media, |
28 ActiveDOMObject | 28 ActiveDOMObject |
29 ] interface HTMLMediaElement : HTMLElement { | 29 ] interface HTMLMediaElement : HTMLElement { |
30 | 30 |
31 // error state | 31 // error state |
32 readonly attribute MediaError error; | 32 readonly attribute MediaError error; |
33 | 33 |
34 // network state | 34 // network state |
35 [Reflect, URL] attribute DOMString src; | 35 [Reflect, URL, PerWorldBindings, ActivityLogging=SetterForIsolatedWorlds] at
tribute DOMString src; |
36 [URL] readonly attribute DOMString currentSrc; | 36 [URL, PerWorldBindings, ActivityLogging=SetterForIsolatedWorlds] readonly at
tribute DOMString currentSrc; |
37 | 37 |
38 const unsigned short NETWORK_EMPTY = 0; | 38 const unsigned short NETWORK_EMPTY = 0; |
39 const unsigned short NETWORK_IDLE = 1; | 39 const unsigned short NETWORK_IDLE = 1; |
40 const unsigned short NETWORK_LOADING = 2; | 40 const unsigned short NETWORK_LOADING = 2; |
41 const unsigned short NETWORK_NO_SOURCE = 3; | 41 const unsigned short NETWORK_NO_SOURCE = 3; |
42 readonly attribute unsigned short networkState; | 42 readonly attribute unsigned short networkState; |
43 attribute DOMString preload; | 43 attribute DOMString preload; |
44 | 44 |
45 readonly attribute TimeRanges buffered; | 45 readonly attribute TimeRanges buffered; |
46 void load(); | 46 void load(); |
47 DOMString canPlayType([Default=Undefined] optional DOMString type, [Default=
Undefined, TreatNullAs=NullString, TreatUndefinedAs=NullString] optional DOMStri
ng keySystem); | 47 DOMString canPlayType([Default=Undefined] optional DOMString type, [Default=
Undefined, TreatNullAs=NullString, TreatUndefinedAs=NullString] optional DOMStri
ng keySystem); |
48 | 48 |
49 // ready state | 49 // ready state |
50 const unsigned short HAVE_NOTHING = 0; | 50 const unsigned short HAVE_NOTHING = 0; |
51 const unsigned short HAVE_METADATA = 1; | 51 const unsigned short HAVE_METADATA = 1; |
52 const unsigned short HAVE_CURRENT_DATA = 2; | 52 const unsigned short HAVE_CURRENT_DATA = 2; |
53 const unsigned short HAVE_FUTURE_DATA = 3; | 53 const unsigned short HAVE_FUTURE_DATA = 3; |
54 const unsigned short HAVE_ENOUGH_DATA = 4; | 54 const unsigned short HAVE_ENOUGH_DATA = 4; |
55 readonly attribute unsigned short readyState; | 55 readonly attribute unsigned short readyState; |
56 readonly attribute boolean seeking; | 56 readonly attribute boolean seeking; |
57 | 57 |
58 // playback state | 58 // playback state |
59 [SetterRaisesException] attribute double currentTime; | 59 [SetterRaisesException] attribute double currentTime; |
60 readonly attribute double initialTime; | 60 readonly attribute double duration; |
61 readonly attribute double startTime; | 61 readonly attribute boolean paused; |
62 readonly attribute double duration; | 62 attribute double defaultPlaybackRate; |
63 readonly attribute boolean paused; | 63 attribute double playbackRate; |
64 attribute double defaultPlaybackRate; | 64 readonly attribute TimeRanges played; |
65 attribute double playbackRate; | 65 readonly attribute TimeRanges seekable; |
66 readonly attribute TimeRanges played; | 66 readonly attribute boolean ended; |
67 readonly attribute TimeRanges seekable; | 67 [Reflect] attribute boolean autoplay; |
68 readonly attribute boolean ended; | 68 [Reflect] attribute boolean loop; |
69 [Reflect] attribute boolean autoplay; | 69 void play(); |
70 [Reflect] attribute boolean loop; | 70 void pause(); |
71 void play(); | |
72 void pause(); | |
73 | 71 |
74 // controls | 72 // media controller |
75 attribute boolean controls; | 73 [Reflect] attribute DOMString mediaGroup; |
76 [SetterRaisesException] attribute double volume; | 74 [CustomSetter] attribute MediaController controller; |
77 attribute boolean muted; | |
78 [Reflect=muted] attribute boolean defaultMuted; | |
79 | 75 |
80 // WebKit extensions | 76 // controls |
81 attribute boolean webkitPreservesPitch; | 77 attribute boolean controls; |
| 78 [SetterRaisesException] attribute double volume; |
| 79 attribute boolean muted; |
| 80 [Reflect=muted] attribute boolean defaultMuted; |
82 | 81 |
83 readonly attribute boolean webkitHasClosedCaptions; | 82 // tracks |
84 attribute boolean webkitClosedCaptionsVisible; | 83 [RuntimeEnabled=VideoTrack] readonly attribute TextTrackList textTracks; |
| 84 [RuntimeEnabled=VideoTrack, RaisesException] TextTrack addTextTrack(DOMStrin
g kind, optional DOMString label, optional DOMString language); |
85 | 85 |
86 // The number of bytes consumed by the media decoder. | 86 // WebKit extensions |
87 readonly attribute unsigned long webkitAudioDecodedByteCount; | |
88 readonly attribute unsigned long webkitVideoDecodedByteCount; | |
89 | 87 |
90 // FIXME: add DeprecateAs=PrefixedMediaGenerateKeyRequest when MediaKeys is read
y. | 88 // The number of bytes consumed by the media decoder. |
91 [EnabledAtRuntime=LegacyEncryptedMedia, RaisesException] void webkitGenerateKeyR
equest([TreatNullAs=NullString, TreatUndefinedAs=NullString] DOMString keySystem
, optional Uint8Array initData); | 89 [MeasureAs=PrefixedAudioDecodedByteCount] readonly attribute unsigned long w
ebkitAudioDecodedByteCount; |
92 [EnabledAtRuntime=LegacyEncryptedMedia, RaisesException] void webkitAddKey([Trea
tNullAs=NullString, TreatUndefinedAs=NullString] DOMString keySystem, Uint8Array
key, optional Uint8Array initData, [Default=NullString] optional DOMString sess
ionId); | 90 [MeasureAs=PrefixedVideoDecodedByteCount] readonly attribute unsigned long w
ebkitVideoDecodedByteCount; |
93 [EnabledAtRuntime=LegacyEncryptedMedia, RaisesException] void webkitCancelKeyReq
uest([TreatNullAs=NullString, TreatUndefinedAs=NullString] DOMString keySystem,
[Default=NullString] optional DOMString sessionId); | |
94 | 91 |
95 [EnabledAtRuntime=LegacyEncryptedMedia] attribute EventHandler onwebkitkeyadded; | 92 // FIXME: add DeprecateAs=PrefixedMediaGenerateKeyRequest when MediaKeys is
ready. |
96 [EnabledAtRuntime=LegacyEncryptedMedia] attribute EventHandler onwebkitkeyerror; | 93 [RuntimeEnabled=PrefixedEncryptedMedia, RaisesException] void webkitGenerate
KeyRequest([TreatNullAs=NullString, TreatUndefinedAs=NullString] DOMString keySy
stem, optional Uint8Array initData); |
97 [EnabledAtRuntime=LegacyEncryptedMedia] attribute EventHandler onwebkitkeymessag
e; | 94 [RuntimeEnabled=PrefixedEncryptedMedia, RaisesException] void webkitAddKey([
TreatNullAs=NullString, TreatUndefinedAs=NullString] DOMString keySystem, Uint8A
rray key, optional Uint8Array initData, [Default=NullString] optional DOMString
sessionId); |
98 [EnabledAtRuntime=LegacyEncryptedMedia] attribute EventHandler onwebkitneedkey; | 95 [RuntimeEnabled=PrefixedEncryptedMedia, RaisesException] void webkitCancelKe
yRequest([TreatNullAs=NullString, TreatUndefinedAs=NullString] DOMString keySyst
em, [Default=NullString] optional DOMString sessionId); |
99 | 96 |
100 [EnabledAtRuntime=EncryptedMedia, Conditional=ENCRYPTED_MEDIA_V2] attribute Medi
aKeys mediaKeys; | 97 [RuntimeEnabled=PrefixedEncryptedMedia] attribute EventHandler onwebkitkeyad
ded; |
| 98 [RuntimeEnabled=PrefixedEncryptedMedia] attribute EventHandler onwebkitkeyer
ror; |
| 99 [RuntimeEnabled=PrefixedEncryptedMedia] attribute EventHandler onwebkitkeyme
ssage; |
| 100 [RuntimeEnabled=PrefixedEncryptedMedia] attribute EventHandler onwebkitneedk
ey; |
101 | 101 |
102 [EnabledAtRuntime=VideoTrack, RaisesException] TextTrack addTextTrack(DOMString
kind, optional DOMString label, optional DOMString language); | 102 [RuntimeEnabled=EncryptedMedia, Conditional=ENCRYPTED_MEDIA_V2] attribute Me
diaKeys mediaKeys; |
103 [EnabledAtRuntime=VideoTrack] readonly attribute TextTrackList textTracks; | |
104 | |
105 [Reflect, TreatNullAs=NullString] attribute DOMString mediaGroup; | |
106 [CustomSetter] attribute MediaController controller; | |
107 }; | 103 }; |
OLD | NEW |