antti | 76787a8 | 2007-10-31 01:03:35 +0000 | [diff] [blame] | 1 | /* |
darin@apple.com | d9786f4 | 2010-06-18 16:47:54 +0000 | [diff] [blame] | 2 | * Copyright (C) 2007, 2010 Apple Inc. All rights reserved. |
antti | 76787a8 | 2007-10-31 01:03:35 +0000 | [diff] [blame] | 3 | * |
| 4 | * Redistribution and use in source and binary forms, with or without |
| 5 | * modification, are permitted provided that the following conditions |
| 6 | * are met: |
| 7 | * 1. Redistributions of source code must retain the above copyright |
| 8 | * notice, this list of conditions and the following disclaimer. |
| 9 | * 2. Redistributions in binary form must reproduce the above copyright |
| 10 | * notice, this list of conditions and the following disclaimer in the |
| 11 | * documentation and/or other materials provided with the distribution. |
| 12 | * |
| 13 | * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY |
| 14 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
| 15 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR |
| 16 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR |
| 17 | * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, |
| 18 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, |
| 19 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR |
| 20 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY |
| 21 | * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 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. |
| 24 | */ |
| 25 | |
| 26 | module html { |
commit-queue@webkit.org | 2b74ad9 | 2011-06-17 18:19:32 +0000 | [diff] [blame] | 27 | interface [ |
| 28 | Conditional=VIDEO, |
crogers@google.com | ae81a11 | 2011-08-15 19:37:22 +0000 | [diff] [blame] | 29 | GenerateNativeConverter |
commit-queue@webkit.org | 2b74ad9 | 2011-06-17 18:19:32 +0000 | [diff] [blame] | 30 | ] HTMLMediaElement : HTMLElement { |
antti | 76787a8 | 2007-10-31 01:03:35 +0000 | [diff] [blame] | 31 | |
| 32 | // error state |
| 33 | readonly attribute MediaError error; |
| 34 | |
| 35 | // network state |
darin@apple.com | 17c2d2c | 2010-08-29 05:48:44 +0000 | [diff] [blame] | 36 | attribute [Reflect, URL] DOMString src; |
abarth@webkit.org | 24b6249 | 2011-05-27 19:53:45 +0000 | [diff] [blame] | 37 | readonly attribute [URL] DOMString currentSrc; |
antti | 76787a8 | 2007-10-31 01:03:35 +0000 | [diff] [blame] | 38 | |
eric.carlson@apple.com | 72a6d93 | 2009-03-23 15:02:34 +0000 | [diff] [blame] | 39 | const unsigned short NETWORK_EMPTY = 0; |
| 40 | const unsigned short NETWORK_IDLE = 1; |
| 41 | const unsigned short NETWORK_LOADING = 2; |
eric.carlson@apple.com | 65b858a | 2010-07-19 20:11:56 +0000 | [diff] [blame] | 42 | const unsigned short NETWORK_NO_SOURCE = 3; |
antti | 76787a8 | 2007-10-31 01:03:35 +0000 | [diff] [blame] | 43 | readonly attribute unsigned short networkState; |
eric.carlson@apple.com | 9f8dbf4 | 2010-03-03 17:19:02 +0000 | [diff] [blame] | 44 | attribute DOMString preload; |
eric.carlson@apple.com | efd612f | 2009-03-05 22:56:52 +0000 | [diff] [blame] | 45 | |
antti | 76787a8 | 2007-10-31 01:03:35 +0000 | [diff] [blame] | 46 | readonly attribute TimeRanges buffered; |
commit-queue@webkit.org | 62c8e33 | 2011-06-16 18:01:30 +0000 | [diff] [blame] | 47 | void load() |
antti | 76787a8 | 2007-10-31 01:03:35 +0000 | [diff] [blame] | 48 | raises (DOMException); |
abarth@webkit.org | f09f1cc | 2011-08-05 07:30:29 +0000 | [diff] [blame] | 49 | DOMString canPlayType(in [Optional=CallWithDefaultValue] DOMString type); |
eric.carlson@apple.com | c502984 | 2009-03-04 22:21:16 +0000 | [diff] [blame] | 50 | |
antti | 76787a8 | 2007-10-31 01:03:35 +0000 | [diff] [blame] | 51 | // ready state |
eric.carlson@apple.com | 72a6d93 | 2009-03-23 15:02:34 +0000 | [diff] [blame] | 52 | const unsigned short HAVE_NOTHING = 0; |
| 53 | const unsigned short HAVE_METADATA = 1; |
| 54 | const unsigned short HAVE_CURRENT_DATA = 2; |
| 55 | const unsigned short HAVE_FUTURE_DATA = 3; |
| 56 | const unsigned short HAVE_ENOUGH_DATA = 4; |
antti | 76787a8 | 2007-10-31 01:03:35 +0000 | [diff] [blame] | 57 | readonly attribute unsigned short readyState; |
| 58 | readonly attribute boolean seeking; |
| 59 | |
| 60 | // playback state |
| 61 | attribute float currentTime |
| 62 | setter raises (DOMException); |
eric.carlson@apple.com | e6be934 | 2009-05-14 17:51:28 +0000 | [diff] [blame] | 63 | readonly attribute float startTime; |
antti | 76787a8 | 2007-10-31 01:03:35 +0000 | [diff] [blame] | 64 | readonly attribute float duration; |
| 65 | readonly attribute boolean paused; |
eric.carlson@apple.com | 72a6d93 | 2009-03-23 15:02:34 +0000 | [diff] [blame] | 66 | attribute float defaultPlaybackRate; |
| 67 | attribute float playbackRate; |
antti | 76787a8 | 2007-10-31 01:03:35 +0000 | [diff] [blame] | 68 | readonly attribute TimeRanges played; |
| 69 | readonly attribute TimeRanges seekable; |
| 70 | readonly attribute boolean ended; |
darin@apple.com | d9786f4 | 2010-06-18 16:47:54 +0000 | [diff] [blame] | 71 | attribute [Reflect] boolean autoplay; |
| 72 | attribute [Reflect] boolean loop; |
commit-queue@webkit.org | 62c8e33 | 2011-06-16 18:01:30 +0000 | [diff] [blame] | 73 | void play(); |
| 74 | void pause(); |
antti | 76787a8 | 2007-10-31 01:03:35 +0000 | [diff] [blame] | 75 | |
antti | 76787a8 | 2007-10-31 01:03:35 +0000 | [diff] [blame] | 76 | // controls |
| 77 | attribute boolean controls; |
| 78 | attribute float volume |
| 79 | setter raises (DOMException); |
| 80 | attribute boolean muted; |
beidson@apple.com | d9bfdc8 | 2009-06-23 19:05:30 +0000 | [diff] [blame] | 81 | |
eric.carlson@apple.com | 8cb301d | 2009-11-12 20:23:15 +0000 | [diff] [blame] | 82 | // WebKit extensions |
beidson@apple.com | d9bfdc8 | 2009-06-23 19:05:30 +0000 | [diff] [blame] | 83 | attribute boolean webkitPreservesPitch; |
eric.carlson@apple.com | 8cb301d | 2009-11-12 20:23:15 +0000 | [diff] [blame] | 84 | |
eric.carlson@apple.com | 9f2f9c6 | 2009-11-19 18:14:01 +0000 | [diff] [blame] | 85 | readonly attribute boolean webkitHasClosedCaptions; |
| 86 | attribute boolean webkitClosedCaptionsVisible; |
dbates@webkit.org | e793e54 | 2011-02-02 19:56:36 +0000 | [diff] [blame] | 87 | |
dbates@webkit.org | e793e54 | 2011-02-02 19:56:36 +0000 | [diff] [blame] | 88 | // The number of bytes consumed by the media decoder. |
paroga@webkit.org | 186b1d7 | 2011-07-22 15:50:35 +0000 | [diff] [blame] | 89 | readonly attribute [Conditional=MEDIA_STATISTICS] unsigned long webkitAudioDecodedByteCount; |
| 90 | readonly attribute [Conditional=MEDIA_STATISTICS] unsigned long webkitVideoDecodedByteCount; |
commit-queue@webkit.org | 7b35231 | 2011-08-30 23:15:56 +0000 | [diff] [blame^] | 91 | |
| 92 | #if defined(ENABLE_MEDIA_SOURCE) && ENABLE_MEDIA_SOURCE |
| 93 | // URL passed to src attribute to enable the media source logic. |
| 94 | readonly attribute [URL] DOMString webkitMediaSourceURL; |
| 95 | |
| 96 | // Appends media to to the source. |
| 97 | void webkitSourceAppend(in Uint8Array data) raises (DOMException); |
| 98 | |
| 99 | // Signals the end of stream. |
| 100 | const unsigned short EOS_NO_ERROR = 0; // End of stream reached w/o error. |
| 101 | const unsigned short EOS_NETWORK_ERR = 1; // A network error triggered end of stream. |
| 102 | const unsigned short EOS_DECODE_ERR = 2; // A decode error triggered end of stream. |
| 103 | void webkitSourceEndOfStream(in unsigned short status) raises (DOMException); |
| 104 | |
| 105 | // Indicates the current state of the media source. |
| 106 | const unsigned short SOURCE_CLOSED = 0; |
| 107 | const unsigned short SOURCE_OPEN = 1; |
| 108 | const unsigned short SOURCE_ENDED = 2; |
| 109 | readonly attribute unsigned short webkitSourceState; |
| 110 | #endif |
antti | 76787a8 | 2007-10-31 01:03:35 +0000 | [diff] [blame] | 111 | }; |
| 112 | } |