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 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
186 void forgetResourceSpecificTracks(); | 186 void forgetResourceSpecificTracks(); |
187 | 187 |
188 void didAddTrackElement(HTMLTrackElement*); | 188 void didAddTrackElement(HTMLTrackElement*); |
189 void didRemoveTrackElement(HTMLTrackElement*); | 189 void didRemoveTrackElement(HTMLTrackElement*); |
190 | 190 |
191 WebMediaPlayer::TrackId addAudioTrack(const String& id, WebMediaPlayerClient
::AudioTrackKind, const AtomicString& label, const AtomicString& language, bool
enabled); | 191 WebMediaPlayer::TrackId addAudioTrack(const String& id, WebMediaPlayerClient
::AudioTrackKind, const AtomicString& label, const AtomicString& language, bool
enabled); |
192 void removeAudioTrack(WebMediaPlayer::TrackId); | 192 void removeAudioTrack(WebMediaPlayer::TrackId); |
193 WebMediaPlayer::TrackId addVideoTrack(const String& id, WebMediaPlayerClient
::VideoTrackKind, const AtomicString& label, const AtomicString& language, bool
selected); | 193 WebMediaPlayer::TrackId addVideoTrack(const String& id, WebMediaPlayerClient
::VideoTrackKind, const AtomicString& label, const AtomicString& language, bool
selected); |
194 void removeVideoTrack(WebMediaPlayer::TrackId); | 194 void removeVideoTrack(WebMediaPlayer::TrackId); |
195 | 195 |
196 virtual void mediaPlayerDidAddTextTrack(WebInbandTextTrack*) override final; | 196 void mediaPlayerDidAddTextTrack(WebInbandTextTrack*) final; |
197 virtual void mediaPlayerDidRemoveTextTrack(WebInbandTextTrack*) override fin
al; | 197 void mediaPlayerDidRemoveTextTrack(WebInbandTextTrack*) final; |
198 // FIXME: Remove this when WebMediaPlayerClientImpl::loadInternal does not d
epend on it. | 198 // FIXME: Remove this when WebMediaPlayerClientImpl::loadInternal does not d
epend on it. |
199 virtual KURL mediaPlayerPosterURL() override { return KURL(); } | 199 KURL mediaPlayerPosterURL() override { return KURL(); } |
200 | 200 |
201 void honorUserPreferencesForAutomaticTextTrackSelection(); | 201 void honorUserPreferencesForAutomaticTextTrackSelection(); |
202 | 202 |
203 bool textTracksAreReady() const; | 203 bool textTracksAreReady() const; |
204 enum VisibilityChangeAssumption { | 204 enum VisibilityChangeAssumption { |
205 AssumeNoVisibleChange, | 205 AssumeNoVisibleChange, |
206 AssumeVisibleChange | 206 AssumeVisibleChange |
207 }; | 207 }; |
208 void configureTextTrackDisplay(VisibilityChangeAssumption); | 208 void configureTextTrackDisplay(VisibilityChangeAssumption); |
209 void updateTextTrackDisplay(); | 209 void updateTextTrackDisplay(); |
(...skipping 28 matching lines...) Expand all Loading... |
238 MediaControls* mediaControls() const; | 238 MediaControls* mediaControls() const; |
239 | 239 |
240 // Notifies the media element that the media controls became visible, so | 240 // Notifies the media element that the media controls became visible, so |
241 // that text track layout may be updated to avoid overlapping them. | 241 // that text track layout may be updated to avoid overlapping them. |
242 void mediaControlsDidBecomeVisible(); | 242 void mediaControlsDidBecomeVisible(); |
243 | 243 |
244 void sourceWasRemoved(HTMLSourceElement*); | 244 void sourceWasRemoved(HTMLSourceElement*); |
245 void sourceWasAdded(HTMLSourceElement*); | 245 void sourceWasAdded(HTMLSourceElement*); |
246 | 246 |
247 // ActiveDOMObject functions. | 247 // ActiveDOMObject functions. |
248 virtual bool hasPendingActivity() const override final; | 248 bool hasPendingActivity() const final; |
249 virtual void contextDestroyed() override final; | 249 void contextDestroyed() final; |
250 | 250 |
251 #if ENABLE(WEB_AUDIO) | 251 #if ENABLE(WEB_AUDIO) |
252 AudioSourceProviderClient* audioSourceNode() { return m_audioSourceNode; } | 252 AudioSourceProviderClient* audioSourceNode() { return m_audioSourceNode; } |
253 void setAudioSourceNode(AudioSourceProviderClient*); | 253 void setAudioSourceNode(AudioSourceProviderClient*); |
254 | 254 |
255 AudioSourceProvider* audioSourceProvider(); | 255 AudioSourceProvider* audioSourceProvider(); |
256 #endif | 256 #endif |
257 | 257 |
258 enum InvalidURLAction { DoNothing, Complain }; | 258 enum InvalidURLAction { DoNothing, Complain }; |
259 bool isSafeToLoadURL(const KURL&, InvalidURLAction); | 259 bool isSafeToLoadURL(const KURL&, InvalidURLAction); |
(...skipping 10 matching lines...) Expand all Loading... |
270 | 270 |
271 // Returns the "effective media volume" value as specified in the HTML5 spec
. | 271 // Returns the "effective media volume" value as specified in the HTML5 spec
. |
272 double effectiveMediaVolume() const; | 272 double effectiveMediaVolume() const; |
273 | 273 |
274 // Predicates also used when dispatching wrapper creation (cf. [SpecialWrapF
or] IDL attribute usage.) | 274 // Predicates also used when dispatching wrapper creation (cf. [SpecialWrapF
or] IDL attribute usage.) |
275 virtual bool isHTMLAudioElement() const { return false; } | 275 virtual bool isHTMLAudioElement() const { return false; } |
276 virtual bool isHTMLVideoElement() const { return false; } | 276 virtual bool isHTMLVideoElement() const { return false; } |
277 | 277 |
278 protected: | 278 protected: |
279 HTMLMediaElement(const QualifiedName&, Document&); | 279 HTMLMediaElement(const QualifiedName&, Document&); |
280 virtual ~HTMLMediaElement(); | 280 ~HTMLMediaElement() override; |
281 #if ENABLE(OILPAN) | 281 #if ENABLE(OILPAN) |
282 void dispose(); | 282 void dispose(); |
283 #endif | 283 #endif |
284 | 284 |
285 virtual void parseAttribute(const QualifiedName&, const AtomicString&) overr
ide; | 285 void parseAttribute(const QualifiedName&, const AtomicString&) override; |
286 virtual void finishParsingChildren() override final; | 286 void finishParsingChildren() final; |
287 virtual bool isURLAttribute(const Attribute&) const override; | 287 bool isURLAttribute(const Attribute&) const override; |
288 virtual void attach(const AttachContext& = AttachContext()) override; | 288 void attach(const AttachContext& = AttachContext()) override; |
289 | 289 |
290 virtual void didMoveToNewDocument(Document& oldDocument) override; | 290 void didMoveToNewDocument(Document& oldDocument) override; |
291 | 291 |
292 enum DisplayMode { Unknown, Poster, Video }; | 292 enum DisplayMode { Unknown, Poster, Video }; |
293 DisplayMode displayMode() const { return m_displayMode; } | 293 DisplayMode displayMode() const { return m_displayMode; } |
294 virtual void setDisplayMode(DisplayMode mode) { m_displayMode = mode; } | 294 virtual void setDisplayMode(DisplayMode mode) { m_displayMode = mode; } |
295 | 295 |
296 void setControllerInternal(PassRefPtrWillBeRawPtr<MediaController>); | 296 void setControllerInternal(PassRefPtrWillBeRawPtr<MediaController>); |
297 | 297 |
298 private: | 298 private: |
299 void createMediaPlayer(); | 299 void createMediaPlayer(); |
300 | 300 |
301 virtual bool alwaysCreateUserAgentShadowRoot() const override final { return
true; } | 301 bool alwaysCreateUserAgentShadowRoot() const final { return true; } |
302 virtual bool areAuthorShadowsAllowed() const override final { return false;
} | 302 bool areAuthorShadowsAllowed() const final { return false; } |
303 | 303 |
304 virtual bool supportsFocus() const override final; | 304 bool supportsFocus() const final; |
305 virtual bool isMouseFocusable() const override final; | 305 bool isMouseFocusable() const final; |
306 virtual bool layoutObjectIsNeeded(const ComputedStyle&) override; | 306 bool layoutObjectIsNeeded(const ComputedStyle&) override; |
307 virtual LayoutObject* createLayoutObject(const ComputedStyle&) override; | 307 LayoutObject* createLayoutObject(const ComputedStyle&) override; |
308 virtual InsertionNotificationRequest insertedInto(ContainerNode*) override f
inal; | 308 InsertionNotificationRequest insertedInto(ContainerNode*) final; |
309 virtual void didNotifySubtreeInsertionsToDocument() override; | 309 void didNotifySubtreeInsertionsToDocument() override; |
310 virtual void removedFrom(ContainerNode*) override final; | 310 void removedFrom(ContainerNode*) final; |
311 virtual void didRecalcStyle(StyleRecalcChange) override final; | 311 void didRecalcStyle(StyleRecalcChange) final; |
312 | 312 |
313 virtual bool canStartSelection() const override { return false; } | 313 bool canStartSelection() const override { return false; } |
314 | 314 |
315 virtual void didBecomeFullscreenElement() override final; | 315 void didBecomeFullscreenElement() final; |
316 virtual void willStopBeingFullscreenElement() override final; | 316 void willStopBeingFullscreenElement() final; |
317 virtual bool isInteractiveContent() const override final; | 317 bool isInteractiveContent() const final; |
318 virtual void defaultEventHandler(Event*) override final; | 318 void defaultEventHandler(Event*) final; |
319 | 319 |
320 // ActiveDOMObject functions. | 320 // ActiveDOMObject functions. |
321 virtual void stop() override final; | 321 void stop() final; |
322 | 322 |
323 virtual void updateDisplayState() { } | 323 virtual void updateDisplayState() { } |
324 | 324 |
325 void setReadyState(ReadyState); | 325 void setReadyState(ReadyState); |
326 void setNetworkState(WebMediaPlayer::NetworkState); | 326 void setNetworkState(WebMediaPlayer::NetworkState); |
327 | 327 |
328 virtual void mediaPlayerNetworkStateChanged() override final; | 328 void mediaPlayerNetworkStateChanged() final; |
329 virtual void mediaPlayerReadyStateChanged() override final; | 329 void mediaPlayerReadyStateChanged() final; |
330 virtual void mediaPlayerTimeChanged() override final; | 330 void mediaPlayerTimeChanged() final; |
331 virtual void mediaPlayerDurationChanged() override final; | 331 void mediaPlayerDurationChanged() final; |
332 virtual void mediaPlayerPlaybackStateChanged() override final; | 332 void mediaPlayerPlaybackStateChanged() final; |
333 virtual void mediaPlayerRequestSeek(double) override final; | 333 void mediaPlayerRequestSeek(double) final; |
334 virtual void mediaPlayerRepaint() override final; | 334 void mediaPlayerRepaint() final; |
335 virtual void mediaPlayerSizeChanged() override final; | 335 void mediaPlayerSizeChanged() final; |
336 virtual void mediaPlayerSetWebLayer(WebLayer*) override final; | 336 void mediaPlayerSetWebLayer(WebLayer*) final; |
337 virtual void mediaPlayerMediaSourceOpened(WebMediaSource*) override final; | 337 void mediaPlayerMediaSourceOpened(WebMediaSource*) final; |
338 | 338 |
339 void loadTimerFired(Timer<HTMLMediaElement>*); | 339 void loadTimerFired(Timer<HTMLMediaElement>*); |
340 void progressEventTimerFired(Timer<HTMLMediaElement>*); | 340 void progressEventTimerFired(Timer<HTMLMediaElement>*); |
341 void playbackProgressTimerFired(Timer<HTMLMediaElement>*); | 341 void playbackProgressTimerFired(Timer<HTMLMediaElement>*); |
342 void startPlaybackProgressTimer(); | 342 void startPlaybackProgressTimer(); |
343 void startProgressEventTimer(); | 343 void startProgressEventTimer(); |
344 void stopPeriodicTimers(); | 344 void stopPeriodicTimers(); |
345 | 345 |
346 void seek(double time); | 346 void seek(double time); |
347 void finishSeek(); | 347 void finishSeek(); |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
407 | 407 |
408 void setShouldDelayLoadEvent(bool); | 408 void setShouldDelayLoadEvent(bool); |
409 void invalidateCachedTime(); | 409 void invalidateCachedTime(); |
410 void refreshCachedTime() const; | 410 void refreshCachedTime() const; |
411 | 411 |
412 void ensureMediaControls(); | 412 void ensureMediaControls(); |
413 void configureMediaControls(); | 413 void configureMediaControls(); |
414 | 414 |
415 TextTrackContainer& ensureTextTrackContainer(); | 415 TextTrackContainer& ensureTextTrackContainer(); |
416 | 416 |
417 virtual void* preDispatchEventHandler(Event*) override final; | 417 void* preDispatchEventHandler(Event*) final; |
418 | 418 |
419 void changeNetworkStateFromLoadingToIdle(); | 419 void changeNetworkStateFromLoadingToIdle(); |
420 | 420 |
421 const AtomicString& mediaGroup() const; | 421 const AtomicString& mediaGroup() const; |
422 void setMediaGroup(const AtomicString&); | 422 void setMediaGroup(const AtomicString&); |
423 void updateMediaController(); | 423 void updateMediaController(); |
424 bool isBlocked() const; | 424 bool isBlocked() const; |
425 bool isBlockedOnMediaController() const; | 425 bool isBlockedOnMediaController() const; |
426 bool isAutoplaying() const { return m_autoplaying; } | 426 bool isAutoplaying() const { return m_autoplaying; } |
427 | 427 |
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
576 inline bool isHTMLMediaElement(const HTMLElement& element) | 576 inline bool isHTMLMediaElement(const HTMLElement& element) |
577 { | 577 { |
578 return isHTMLAudioElement(element) || isHTMLVideoElement(element); | 578 return isHTMLAudioElement(element) || isHTMLVideoElement(element); |
579 } | 579 } |
580 | 580 |
581 DEFINE_HTMLELEMENT_TYPE_CASTS_WITH_FUNCTION(HTMLMediaElement); | 581 DEFINE_HTMLELEMENT_TYPE_CASTS_WITH_FUNCTION(HTMLMediaElement); |
582 | 582 |
583 } // namespace blink | 583 } // namespace blink |
584 | 584 |
585 #endif // HTMLMediaElement_h | 585 #endif // HTMLMediaElement_h |
OLD | NEW |