| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. All rights
reserved. | 2 * Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012, 2013 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 |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 | 91 |
| 92 enum DelayedActionType { | 92 enum DelayedActionType { |
| 93 LoadMediaResource = 1 << 0, | 93 LoadMediaResource = 1 << 0, |
| 94 LoadTextTrackResource = 1 << 1, | 94 LoadTextTrackResource = 1 << 1, |
| 95 TextTrackChangesNotification = 1 << 2 | 95 TextTrackChangesNotification = 1 << 2 |
| 96 }; | 96 }; |
| 97 void scheduleDelayedAction(DelayedActionType); | 97 void scheduleDelayedAction(DelayedActionType); |
| 98 | 98 |
| 99 bool isActive() const { return m_active; } | 99 bool isActive() const { return m_active; } |
| 100 | 100 |
| 101 // DOM API | 101 // error state |
| 102 // error state | |
| 103 PassRefPtr<MediaError> error() const; | 102 PassRefPtr<MediaError> error() const; |
| 104 | 103 |
| 105 // network state | 104 // network state |
| 106 void setSrc(const String&); | 105 void setSrc(const String&); |
| 107 const KURL& currentSrc() const { return m_currentSrc; } | 106 const KURL& currentSrc() const { return m_currentSrc; } |
| 108 | 107 |
| 109 enum NetworkState { NETWORK_EMPTY, NETWORK_IDLE, NETWORK_LOADING, NETWORK_NO
_SOURCE }; | 108 enum NetworkState { NETWORK_EMPTY, NETWORK_IDLE, NETWORK_LOADING, NETWORK_NO
_SOURCE }; |
| 110 NetworkState networkState() const; | 109 NetworkState networkState() const; |
| 111 | 110 |
| 112 String preload() const; | 111 String preload() const; |
| 113 void setPreload(const String&); | 112 void setPreload(const String&); |
| 114 | 113 |
| 115 PassRefPtr<TimeRanges> buffered() const; | 114 PassRefPtr<TimeRanges> buffered() const; |
| 116 void load(); | 115 void load(); |
| 117 String canPlayType(const String& mimeType, const String& keySystem = String(
), const KURL& = KURL()) const; | 116 String canPlayType(const String& mimeType, const String& keySystem = String(
), const KURL& = KURL()) const; |
| 118 | 117 |
| 119 // ready state | 118 // ready state |
| 120 ReadyState readyState() const; | 119 ReadyState readyState() const; |
| 121 bool seeking() const; | 120 bool seeking() const; |
| 122 | 121 |
| 123 // playback state | 122 // playback state |
| 124 double currentTime() const; | 123 double currentTime() const; |
| 125 void setCurrentTime(double, ExceptionState&); | 124 void setCurrentTime(double, ExceptionState&); |
| 126 double duration() const; | 125 double duration() const; |
| 127 bool paused() const; | 126 bool paused() const; |
| 128 double defaultPlaybackRate() const; | 127 double defaultPlaybackRate() const; |
| 129 void setDefaultPlaybackRate(double); | 128 void setDefaultPlaybackRate(double); |
| 130 double playbackRate() const; | 129 double playbackRate() const; |
| 131 void setPlaybackRate(double); | 130 void setPlaybackRate(double); |
| 132 void updatePlaybackRate(); | 131 void updatePlaybackRate(); |
| 133 PassRefPtr<TimeRanges> played(); | 132 PassRefPtr<TimeRanges> played(); |
| 134 PassRefPtr<TimeRanges> seekable() const; | 133 PassRefPtr<TimeRanges> seekable() const; |
| 135 bool ended() const; | 134 bool ended() const; |
| 136 bool autoplay() const; | 135 bool autoplay() const; |
| 137 bool loop() const; | 136 bool loop() const; |
| 138 void setLoop(bool b); | 137 void setLoop(bool b); |
| 139 void play(); | 138 void play(); |
| 140 void pause(); | 139 void pause(); |
| 141 | 140 |
| 142 // Statistics | 141 // statistics |
| 143 unsigned webkitAudioDecodedByteCount() const; | 142 unsigned webkitAudioDecodedByteCount() const; |
| 144 unsigned webkitVideoDecodedByteCount() const; | 143 unsigned webkitVideoDecodedByteCount() const; |
| 145 | 144 |
| 146 // Media Source. | 145 // media source extensions |
| 147 void closeMediaSource(); | 146 void closeMediaSource(); |
| 148 | |
| 149 void durationChanged(double duration); | 147 void durationChanged(double duration); |
| 150 | 148 |
| 149 // encrypted media extensions |
| 151 void webkitGenerateKeyRequest(const String& keySystem, PassRefPtr<Uint8Array
> initData, ExceptionState&); | 150 void webkitGenerateKeyRequest(const String& keySystem, PassRefPtr<Uint8Array
> initData, ExceptionState&); |
| 152 void webkitGenerateKeyRequest(const String& keySystem, ExceptionState&); | 151 void webkitGenerateKeyRequest(const String& keySystem, ExceptionState&); |
| 153 void webkitAddKey(const String& keySystem, PassRefPtr<Uint8Array> key, PassR
efPtr<Uint8Array> initData, const String& sessionId, ExceptionState&); | 152 void webkitAddKey(const String& keySystem, PassRefPtr<Uint8Array> key, PassR
efPtr<Uint8Array> initData, const String& sessionId, ExceptionState&); |
| 154 void webkitAddKey(const String& keySystem, PassRefPtr<Uint8Array> key, Excep
tionState&); | 153 void webkitAddKey(const String& keySystem, PassRefPtr<Uint8Array> key, Excep
tionState&); |
| 155 void webkitCancelKeyRequest(const String& keySystem, const String& sessionId
, ExceptionState&); | 154 void webkitCancelKeyRequest(const String& keySystem, const String& sessionId
, ExceptionState&); |
| 156 | 155 |
| 157 DEFINE_ATTRIBUTE_EVENT_LISTENER(webkitkeyadded); | 156 DEFINE_ATTRIBUTE_EVENT_LISTENER(webkitkeyadded); |
| 158 DEFINE_ATTRIBUTE_EVENT_LISTENER(webkitkeyerror); | 157 DEFINE_ATTRIBUTE_EVENT_LISTENER(webkitkeyerror); |
| 159 DEFINE_ATTRIBUTE_EVENT_LISTENER(webkitkeymessage); | 158 DEFINE_ATTRIBUTE_EVENT_LISTENER(webkitkeymessage); |
| 160 DEFINE_ATTRIBUTE_EVENT_LISTENER(webkitneedkey); | 159 DEFINE_ATTRIBUTE_EVENT_LISTENER(webkitneedkey); |
| 161 | 160 |
| 162 #if ENABLE(ENCRYPTED_MEDIA_V2) | 161 #if ENABLE(ENCRYPTED_MEDIA_V2) |
| 163 MediaKeys* mediaKeys() const { return m_mediaKeys.get(); } | 162 MediaKeys* mediaKeys() const { return m_mediaKeys.get(); } |
| 164 void setMediaKeys(MediaKeys*); | 163 void setMediaKeys(MediaKeys*); |
| 165 #endif | 164 #endif |
| 166 | 165 |
| 167 // controls | 166 // controls |
| 168 bool controls() const; | 167 bool controls() const; |
| 169 void setControls(bool); | 168 void setControls(bool); |
| 170 double volume() const; | 169 double volume() const; |
| 171 void setVolume(double, ExceptionState&); | 170 void setVolume(double, ExceptionState&); |
| 172 bool muted() const; | 171 bool muted() const; |
| 173 void setMuted(bool); | 172 void setMuted(bool); |
| 174 | 173 |
| 175 void togglePlayState(); | 174 void togglePlayState(); |
| 176 void beginScrubbing(); | 175 void beginScrubbing(); |
| 177 void endScrubbing(); | 176 void endScrubbing(); |
| (...skipping 423 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 601 inline bool isHTMLMediaElement(const Node& node) | 600 inline bool isHTMLMediaElement(const Node& node) |
| 602 { | 601 { |
| 603 return node.isElementNode() && toElement(node).isMediaElement(); | 602 return node.isElementNode() && toElement(node).isMediaElement(); |
| 604 } | 603 } |
| 605 | 604 |
| 606 DEFINE_NODE_TYPE_CASTS_WITH_FUNCTION(HTMLMediaElement); | 605 DEFINE_NODE_TYPE_CASTS_WITH_FUNCTION(HTMLMediaElement); |
| 607 | 606 |
| 608 } //namespace | 607 } //namespace |
| 609 | 608 |
| 610 #endif | 609 #endif |
| OLD | NEW |