1/* 2 * Copyright (C) 2007, 2010 Apple Inc. All rights reserved. 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 26module html { 27interface [Conditional=VIDEO] HTMLMediaElement : HTMLElement { 28 29 // error state 30 readonly attribute MediaError error; 31 32 // network state 33 attribute [Reflect, URL] DOMString src; 34 readonly attribute DOMString currentSrc; 35 36 const unsigned short NETWORK_EMPTY = 0; 37 const unsigned short NETWORK_IDLE = 1; 38 const unsigned short NETWORK_LOADING = 2; 39 const unsigned short NETWORK_NO_SOURCE = 3; 40 readonly attribute unsigned short networkState; 41 attribute DOMString preload; 42 43 readonly attribute TimeRanges buffered; 44 [NeedsUserGestureCheck] void load() 45 raises (DOMException); 46 DOMString canPlayType(in DOMString type); 47 48 // ready state 49 const unsigned short HAVE_NOTHING = 0; 50 const unsigned short HAVE_METADATA = 1; 51 const unsigned short HAVE_CURRENT_DATA = 2; 52 const unsigned short HAVE_FUTURE_DATA = 3; 53 const unsigned short HAVE_ENOUGH_DATA = 4; 54 readonly attribute unsigned short readyState; 55 readonly attribute boolean seeking; 56 57 // playback state 58 attribute float currentTime 59 setter raises (DOMException); 60 readonly attribute float startTime; 61 readonly attribute float duration; 62 readonly attribute boolean paused; 63 attribute float defaultPlaybackRate; 64 attribute float playbackRate; 65 readonly attribute TimeRanges played; 66 readonly attribute TimeRanges seekable; 67 readonly attribute boolean ended; 68 attribute [Reflect] boolean autoplay; 69 attribute [Reflect] boolean loop; 70 [NeedsUserGestureCheck] void play(); 71 [NeedsUserGestureCheck] void pause(); 72 73 // controls 74 attribute boolean controls; 75 attribute float volume 76 setter raises (DOMException); 77 attribute boolean muted; 78 79 // WebKit extensions 80 attribute boolean webkitPreservesPitch; 81 82 readonly attribute boolean webkitHasClosedCaptions; 83 attribute boolean webkitClosedCaptionsVisible; 84 85#if defined(ENABLE_MEDIA_STATISTICS) && ENABLE_MEDIA_STATISTICS 86 // The number of bytes consumed by the media decoder. 87 readonly attribute unsigned long webkitAudioDecodedByteCount; 88 readonly attribute unsigned long webkitVideoDecodedByteCount; 89#endif 90}; 91} 92