2 * Copyright (C) 2007, 2010 Apple Inc. All rights reserved.
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
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.
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.
27 interface [Conditional=VIDEO] HTMLMediaElement : HTMLElement {
30 readonly attribute MediaError error;
33 attribute [Reflect, URL] DOMString src;
34 readonly attribute DOMString currentSrc;
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;
43 readonly attribute TimeRanges buffered;
44 [NeedsUserGestureCheck] void load()
45 raises (DOMException);
46 DOMString canPlayType(in DOMString type);
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;
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();
74 attribute boolean controls;
75 attribute float volume
76 setter raises (DOMException);
77 attribute boolean muted;
80 attribute boolean webkitPreservesPitch;
82 readonly attribute boolean webkitHasClosedCaptions;
83 attribute boolean webkitClosedCaptionsVisible;
85 #if defined(ENABLE_MEDIA_STATISTICS) && ENABLE_MEDIA_STATISTICS
86 // The number of bytes consumed by the media decoder.
87 readonly attribute unsigned long webkitAudioBytesDecoded;
88 readonly attribute unsigned long webkitVideoBytesDecoded;