| 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 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 96 LoadMediaResource = 1 << 0, | 96 LoadMediaResource = 1 << 0, |
| 97 LoadTextTrackResource = 1 << 1, | 97 LoadTextTrackResource = 1 << 1, |
| 98 TextTrackChangesNotification = 1 << 2 | 98 TextTrackChangesNotification = 1 << 2 |
| 99 }; | 99 }; |
| 100 void scheduleDelayedAction(DelayedActionType); | 100 void scheduleDelayedAction(DelayedActionType); |
| 101 | 101 |
| 102 bool hasRemoteRoutes() const { return m_remoteRoutesAvailable; } | 102 bool hasRemoteRoutes() const { return m_remoteRoutesAvailable; } |
| 103 bool isPlayingRemotely() const { return m_playingRemotely; } | 103 bool isPlayingRemotely() const { return m_playingRemotely; } |
| 104 | 104 |
| 105 // error state | 105 // error state |
| 106 PassRefPtrWillBeRawPtr<MediaError> error() const; | 106 MediaError* error() const; |
| 107 | 107 |
| 108 // network state | 108 // network state |
| 109 void setSrc(const AtomicString&); | 109 void setSrc(const AtomicString&); |
| 110 const KURL& currentSrc() const { return m_currentSrc; } | 110 const KURL& currentSrc() const { return m_currentSrc; } |
| 111 | 111 |
| 112 enum NetworkState { NETWORK_EMPTY, NETWORK_IDLE, NETWORK_LOADING, NETWORK_NO
_SOURCE }; | 112 enum NetworkState { NETWORK_EMPTY, NETWORK_IDLE, NETWORK_LOADING, NETWORK_NO
_SOURCE }; |
| 113 NetworkState networkState() const; | 113 NetworkState networkState() const; |
| 114 | 114 |
| 115 String preload() const; | 115 String preload() const; |
| 116 void setPreload(const AtomicString&); | 116 void setPreload(const AtomicString&); |
| 117 WebMediaPlayer::Preload preloadType() const; | 117 WebMediaPlayer::Preload preloadType() const; |
| 118 WebMediaPlayer::Preload effectivePreloadType() const; | 118 WebMediaPlayer::Preload effectivePreloadType() const; |
| 119 | 119 |
| 120 PassRefPtrWillBeRawPtr<TimeRanges> buffered() const; | 120 TimeRanges* buffered() const; |
| 121 void load(); | 121 void load(); |
| 122 String canPlayType(const String& mimeType, const String& keySystem = String(
)) const; | 122 String canPlayType(const String& mimeType, const String& keySystem = String(
)) const; |
| 123 | 123 |
| 124 // ready state | 124 // ready state |
| 125 enum ReadyState { HAVE_NOTHING, HAVE_METADATA, HAVE_CURRENT_DATA, HAVE_FUTUR
E_DATA, HAVE_ENOUGH_DATA }; | 125 enum ReadyState { HAVE_NOTHING, HAVE_METADATA, HAVE_CURRENT_DATA, HAVE_FUTUR
E_DATA, HAVE_ENOUGH_DATA }; |
| 126 ReadyState readyState() const; | 126 ReadyState readyState() const; |
| 127 bool seeking() const; | 127 bool seeking() const; |
| 128 | 128 |
| 129 // playback state | 129 // playback state |
| 130 double currentTime() const; | 130 double currentTime() const; |
| 131 void setCurrentTime(double, ExceptionState&); | 131 void setCurrentTime(double, ExceptionState&); |
| 132 double duration() const; | 132 double duration() const; |
| 133 bool paused() const; | 133 bool paused() const; |
| 134 double defaultPlaybackRate() const; | 134 double defaultPlaybackRate() const; |
| 135 void setDefaultPlaybackRate(double); | 135 void setDefaultPlaybackRate(double); |
| 136 double playbackRate() const; | 136 double playbackRate() const; |
| 137 void setPlaybackRate(double); | 137 void setPlaybackRate(double); |
| 138 void updatePlaybackRate(); | 138 void updatePlaybackRate(); |
| 139 PassRefPtrWillBeRawPtr<TimeRanges> played(); | 139 TimeRanges* played(); |
| 140 PassRefPtrWillBeRawPtr<TimeRanges> seekable() const; | 140 TimeRanges* seekable() const; |
| 141 bool ended() const; | 141 bool ended() const; |
| 142 bool autoplay() const; | 142 bool autoplay() const; |
| 143 bool loop() const; | 143 bool loop() const; |
| 144 void setLoop(bool); | 144 void setLoop(bool); |
| 145 void play(); | 145 void play(); |
| 146 void pause(); | 146 void pause(); |
| 147 void requestRemotePlayback(); | 147 void requestRemotePlayback(); |
| 148 void requestRemotePlaybackControl(); | 148 void requestRemotePlaybackControl(); |
| 149 | 149 |
| 150 // statistics | 150 // statistics |
| (...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 357 void startPlayerLoad(); | 357 void startPlayerLoad(); |
| 358 void setPlayerPreload(); | 358 void setPlayerPreload(); |
| 359 WebMediaPlayer::LoadType loadType() const; | 359 WebMediaPlayer::LoadType loadType() const; |
| 360 void scheduleNextSourceChild(); | 360 void scheduleNextSourceChild(); |
| 361 void loadNextSourceChild(); | 361 void loadNextSourceChild(); |
| 362 void userCancelledLoad(); | 362 void userCancelledLoad(); |
| 363 void clearMediaPlayer(int flags); | 363 void clearMediaPlayer(int flags); |
| 364 void clearMediaPlayerAndAudioSourceProviderClientWithoutLocking(); | 364 void clearMediaPlayerAndAudioSourceProviderClientWithoutLocking(); |
| 365 bool havePotentialSourceChild(); | 365 bool havePotentialSourceChild(); |
| 366 void noneSupported(); | 366 void noneSupported(); |
| 367 void mediaEngineError(PassRefPtrWillBeRawPtr<MediaError>); | 367 void mediaEngineError(MediaError*); |
| 368 void cancelPendingEventsAndCallbacks(); | 368 void cancelPendingEventsAndCallbacks(); |
| 369 void waitForSourceChange(); | 369 void waitForSourceChange(); |
| 370 void prepareToPlay(); | 370 void prepareToPlay(); |
| 371 | 371 |
| 372 KURL selectNextSourceChild(ContentType*, String* keySystem, InvalidURLAction
); | 372 KURL selectNextSourceChild(ContentType*, String* keySystem, InvalidURLAction
); |
| 373 | 373 |
| 374 void mediaLoadingFailed(WebMediaPlayer::NetworkState); | 374 void mediaLoadingFailed(WebMediaPlayer::NetworkState); |
| 375 | 375 |
| 376 // deferred loading (preload=none) | 376 // deferred loading (preload=none) |
| 377 bool loadIsDeferred() const; | 377 bool loadIsDeferred() const; |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 444 // Sets the selected/enabled tracks if they aren't set before we initially | 444 // Sets the selected/enabled tracks if they aren't set before we initially |
| 445 // transition to HAVE_METADATA. | 445 // transition to HAVE_METADATA. |
| 446 void selectInitialTracksIfNecessary(); | 446 void selectInitialTracksIfNecessary(); |
| 447 | 447 |
| 448 void audioTracksTimerFired(Timer<HTMLMediaElement>*); | 448 void audioTracksTimerFired(Timer<HTMLMediaElement>*); |
| 449 | 449 |
| 450 Timer<HTMLMediaElement> m_loadTimer; | 450 Timer<HTMLMediaElement> m_loadTimer; |
| 451 Timer<HTMLMediaElement> m_progressEventTimer; | 451 Timer<HTMLMediaElement> m_progressEventTimer; |
| 452 Timer<HTMLMediaElement> m_playbackProgressTimer; | 452 Timer<HTMLMediaElement> m_playbackProgressTimer; |
| 453 Timer<HTMLMediaElement> m_audioTracksTimer; | 453 Timer<HTMLMediaElement> m_audioTracksTimer; |
| 454 RefPtrWillBeMember<TimeRanges> m_playedTimeRanges; | 454 PersistentWillBeMember<TimeRanges> m_playedTimeRanges; |
| 455 OwnPtrWillBeMember<GenericEventQueue> m_asyncEventQueue; | 455 OwnPtrWillBeMember<GenericEventQueue> m_asyncEventQueue; |
| 456 | 456 |
| 457 double m_playbackRate; | 457 double m_playbackRate; |
| 458 double m_defaultPlaybackRate; | 458 double m_defaultPlaybackRate; |
| 459 NetworkState m_networkState; | 459 NetworkState m_networkState; |
| 460 ReadyState m_readyState; | 460 ReadyState m_readyState; |
| 461 ReadyState m_readyStateMaximum; | 461 ReadyState m_readyStateMaximum; |
| 462 KURL m_currentSrc; | 462 KURL m_currentSrc; |
| 463 | 463 |
| 464 RefPtrWillBeMember<MediaError> m_error; | 464 PersistentWillBeMember<MediaError> m_error; |
| 465 | 465 |
| 466 double m_volume; | 466 double m_volume; |
| 467 double m_lastSeekTime; | 467 double m_lastSeekTime; |
| 468 | 468 |
| 469 double m_previousProgressTime; | 469 double m_previousProgressTime; |
| 470 | 470 |
| 471 // Cached duration to suppress duplicate events if duration unchanged. | 471 // Cached duration to suppress duplicate events if duration unchanged. |
| 472 double m_duration; | 472 double m_duration; |
| 473 | 473 |
| 474 // The last time a timeupdate event was sent (wall clock). | 474 // The last time a timeupdate event was sent (wall clock). |
| (...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 626 inline bool isHTMLMediaElement(const HTMLElement& element) | 626 inline bool isHTMLMediaElement(const HTMLElement& element) |
| 627 { | 627 { |
| 628 return isHTMLAudioElement(element) || isHTMLVideoElement(element); | 628 return isHTMLAudioElement(element) || isHTMLVideoElement(element); |
| 629 } | 629 } |
| 630 | 630 |
| 631 DEFINE_HTMLELEMENT_TYPE_CASTS_WITH_FUNCTION(HTMLMediaElement); | 631 DEFINE_HTMLELEMENT_TYPE_CASTS_WITH_FUNCTION(HTMLMediaElement); |
| 632 | 632 |
| 633 } // namespace blink | 633 } // namespace blink |
| 634 | 634 |
| 635 #endif // HTMLMediaElement_h | 635 #endif // HTMLMediaElement_h |
| OLD | NEW |