OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2007, 2008, 2009 Apple Inc. All rights reserved. | 2 * Copyright (C) 2007, 2008, 2009 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 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 // error state | 76 // error state |
77 PassRefPtr<MediaError> error() const; | 77 PassRefPtr<MediaError> error() const; |
78 | 78 |
79 // network state | 79 // network state |
80 KURL src() const; | 80 KURL src() const; |
81 void setSrc(const String&); | 81 void setSrc(const String&); |
82 String currentSrc() const; | 82 String currentSrc() const; |
83 | 83 |
84 enum NetworkState { EMPTY, LOADING, LOADED_METADATA, LOADED_FIRST_FRAME, LOA
DED }; | 84 enum NetworkState { EMPTY, LOADING, LOADED_METADATA, LOADED_FIRST_FRAME, LOA
DED }; |
85 NetworkState networkState() const; | 85 NetworkState networkState() const; |
86 float bufferingRate(); | |
87 PassRefPtr<TimeRanges> buffered() const; | 86 PassRefPtr<TimeRanges> buffered() const; |
88 void load(ExceptionCode&); | 87 void load(ExceptionCode&); |
89 | 88 |
90 String canPlayType(const String& mimeType) const; | 89 String canPlayType(const String& mimeType) const; |
91 | 90 |
92 // ready state | 91 // ready state |
93 enum ReadyState { DATA_UNAVAILABLE, CAN_SHOW_CURRENT_FRAME, CAN_PLAY, CAN_PL
AY_THROUGH }; | 92 enum ReadyState { DATA_UNAVAILABLE, CAN_SHOW_CURRENT_FRAME, CAN_PLAY, CAN_PL
AY_THROUGH }; |
94 ReadyState readyState() const; | 93 ReadyState readyState() const; |
95 bool seeking() const; | 94 bool seeking() const; |
96 | 95 |
97 // playback state | 96 // playback state |
98 float currentTime() const; | 97 float currentTime() const; |
99 void setCurrentTime(float, ExceptionCode&); | 98 void setCurrentTime(float, ExceptionCode&); |
100 float duration() const; | 99 float duration() const; |
101 bool paused() const; | 100 bool paused() const; |
102 float defaultPlaybackRate() const; | 101 float defaultPlaybackRate() const; |
103 void setDefaultPlaybackRate(float, ExceptionCode&); | 102 void setDefaultPlaybackRate(float, ExceptionCode&); |
104 float playbackRate() const; | 103 float playbackRate() const; |
105 void setPlaybackRate(float, ExceptionCode&); | 104 void setPlaybackRate(float, ExceptionCode&); |
106 PassRefPtr<TimeRanges> played() const; | 105 PassRefPtr<TimeRanges> played() const; |
107 PassRefPtr<TimeRanges> seekable() const; | 106 PassRefPtr<TimeRanges> seekable() const; |
108 bool ended() const; | 107 bool ended() const; |
109 bool autoplay() const; | 108 bool autoplay() const; |
110 void setAutoplay(bool b); | 109 void setAutoplay(bool b); |
| 110 bool loop() const; |
| 111 void setLoop(bool b); |
111 void play(ExceptionCode&); | 112 void play(ExceptionCode&); |
112 void pause(ExceptionCode&); | 113 void pause(ExceptionCode&); |
113 | 114 |
114 // looping | |
115 float start() const; | |
116 void setStart(float time); | |
117 float end() const; | |
118 void setEnd(float time); | |
119 float loopStart() const; | |
120 void setLoopStart(float time); | |
121 float loopEnd() const; | |
122 void setLoopEnd(float time); | |
123 unsigned playCount() const; | |
124 void setPlayCount(unsigned, ExceptionCode&); | |
125 unsigned currentLoop() const; | |
126 void setCurrentLoop(unsigned); | |
127 | |
128 // controls | 115 // controls |
129 bool controls() const; | 116 bool controls() const; |
130 void setControls(bool); | 117 void setControls(bool); |
131 float volume() const; | 118 float volume() const; |
132 void setVolume(float, ExceptionCode&); | 119 void setVolume(float, ExceptionCode&); |
133 bool muted() const; | 120 bool muted() const; |
134 void setMuted(bool); | 121 void setMuted(bool); |
135 void togglePlayState(ExceptionCode& ec); | 122 void togglePlayState(ExceptionCode& ec); |
136 void beginScrubbing(); | 123 void beginScrubbing(); |
137 void endScrubbing(); | 124 void endScrubbing(); |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
181 void pauseInternal(ExceptionCode& ec); | 168 void pauseInternal(ExceptionCode& ec); |
182 | 169 |
183 bool processingUserGesture() const; | 170 bool processingUserGesture() const; |
184 bool processingMediaPlayerCallback() const { return m_processingMediaPlayerC
allback > 0; } | 171 bool processingMediaPlayerCallback() const { return m_processingMediaPlayerC
allback > 0; } |
185 void beginProcessingMediaPlayerCallback() { ++m_processingMediaPlayerCallbac
k; } | 172 void beginProcessingMediaPlayerCallback() { ++m_processingMediaPlayerCallbac
k; } |
186 void endProcessingMediaPlayerCallback() { ASSERT(m_processingMediaPlayerCall
back); --m_processingMediaPlayerCallback; } | 173 void endProcessingMediaPlayerCallback() { ASSERT(m_processingMediaPlayerCall
back); --m_processingMediaPlayerCallback; } |
187 | 174 |
188 String selectMediaURL(ContentType& contentType); | 175 String selectMediaURL(ContentType& contentType); |
189 void updateVolume(); | 176 void updateVolume(); |
190 void updatePlayState(); | 177 void updatePlayState(); |
191 float effectiveStart() const; | |
192 float effectiveEnd() const; | |
193 float effectiveLoopStart() const; | |
194 float effectiveLoopEnd() const; | |
195 bool activelyPlaying() const; | 178 bool activelyPlaying() const; |
196 bool endedPlayback() const; | 179 bool endedPlayback() const; |
197 | 180 |
198 // Restrictions to change default behaviors. This is a effectively a compile
time choice at the moment | 181 // Restrictions to change default behaviors. This is a effectively a compile
time choice at the moment |
199 // because there are no accessor methods. | 182 // because there are no accessor methods. |
200 enum BehaviorRestrictions | 183 enum BehaviorRestrictions |
201 { | 184 { |
202 NoRestrictions = 0, | 185 NoRestrictions = 0, |
203 RequireUserGestureForLoadRestriction = 1 << 0, | 186 RequireUserGestureForLoadRestriction = 1 << 0, |
204 RequireUserGestureForRateChangeRestriction = 1 << 1, | 187 RequireUserGestureForRateChangeRestriction = 1 << 1, |
(...skipping 23 matching lines...) Expand all Loading... |
228 | 211 |
229 bool m_paused; | 212 bool m_paused; |
230 bool m_seeking; | 213 bool m_seeking; |
231 | 214 |
232 float m_currentTimeDuringSeek; | 215 float m_currentTimeDuringSeek; |
233 | 216 |
234 unsigned m_previousProgress; | 217 unsigned m_previousProgress; |
235 double m_previousProgressTime; | 218 double m_previousProgressTime; |
236 bool m_sentStalledEvent; | 219 bool m_sentStalledEvent; |
237 | 220 |
238 float m_bufferingRate; | |
239 | |
240 unsigned m_loadNestingLevel; | 221 unsigned m_loadNestingLevel; |
241 unsigned m_terminateLoadBelowNestingLevel; | 222 unsigned m_terminateLoadBelowNestingLevel; |
242 | 223 |
243 bool m_pausedInternal; | 224 bool m_pausedInternal; |
244 bool m_inActiveDocument; | 225 bool m_inActiveDocument; |
245 | 226 |
246 OwnPtr<MediaPlayer> m_player; | 227 OwnPtr<MediaPlayer> m_player; |
247 | 228 |
248 BehaviorRestrictions m_restrictions; | 229 BehaviorRestrictions m_restrictions; |
249 | 230 |
250 // counter incremented while processing a callback from the media player, so
we can avoid | 231 // counter incremented while processing a callback from the media player, so
we can avoid |
251 // calling the media engine recursively | 232 // calling the media engine recursively |
252 int m_processingMediaPlayerCallback; | 233 int m_processingMediaPlayerCallback; |
253 | 234 |
254 // Not all media engines provide enough information about a file to be able
to | 235 // Not all media engines provide enough information about a file to be able
to |
255 // support progress events so setting m_sendProgressEvents disables them | 236 // support progress events so setting m_sendProgressEvents disables them |
256 bool m_sendProgressEvents; | 237 bool m_sendProgressEvents; |
257 | 238 |
258 #if ENABLE(PLUGIN_PROXY_FOR_VIDEO) | 239 #if ENABLE(PLUGIN_PROXY_FOR_VIDEO) |
259 bool m_needWidgetUpdate; | 240 bool m_needWidgetUpdate; |
260 #endif | 241 #endif |
261 }; | 242 }; |
262 | 243 |
263 } //namespace | 244 } //namespace |
264 | 245 |
265 #endif | 246 #endif |
266 #endif | 247 #endif |
OLD | NEW |