| 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 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 118 | 118 |
| 119 // error state | 119 // error state |
| 120 MediaError* error() const; | 120 MediaError* error() const; |
| 121 | 121 |
| 122 // network state | 122 // network state |
| 123 void setSrc(const AtomicString&); | 123 void setSrc(const AtomicString&); |
| 124 const KURL& currentSrc() const { return m_currentSrc; } | 124 const KURL& currentSrc() const { return m_currentSrc; } |
| 125 void setSrcObject(MediaStreamDescriptor*); | 125 void setSrcObject(MediaStreamDescriptor*); |
| 126 MediaStreamDescriptor* getSrcObject() const { return m_srcObject.get(); } | 126 MediaStreamDescriptor* getSrcObject() const { return m_srcObject.get(); } |
| 127 | 127 |
| 128 enum NetworkState { NETWORK_EMPTY, NETWORK_IDLE, NETWORK_LOADING, NETWORK_NO
_SOURCE }; | 128 enum NetworkState { kNetworkEmpty, kNetworkIdle, kNetworkLoading, kNetworkNo
Source }; |
| 129 NetworkState getNetworkState() const; | 129 NetworkState getNetworkState() const; |
| 130 | 130 |
| 131 String preload() const; | 131 String preload() const; |
| 132 void setPreload(const AtomicString&); | 132 void setPreload(const AtomicString&); |
| 133 WebMediaPlayer::Preload preloadType() const; | 133 WebMediaPlayer::Preload preloadType() const; |
| 134 String effectivePreload() const; | 134 String effectivePreload() const; |
| 135 WebMediaPlayer::Preload effectivePreloadType() const; | 135 WebMediaPlayer::Preload effectivePreloadType() const; |
| 136 | 136 |
| 137 TimeRanges* buffered() const; | 137 TimeRanges* buffered() const; |
| 138 void load(); | 138 void load(); |
| 139 String canPlayType(const String& mimeType) const; | 139 String canPlayType(const String& mimeType) const; |
| 140 | 140 |
| 141 // ready state | 141 // ready state |
| 142 enum ReadyState { HAVE_NOTHING, HAVE_METADATA, HAVE_CURRENT_DATA, HAVE_FUTUR
E_DATA, HAVE_ENOUGH_DATA }; | 142 enum ReadyState { kHaveNothing, kHaveMetadata, kHaveCurrentData, kHaveFuture
Data, kHaveEnoughData }; |
| 143 ReadyState getReadyState() const; | 143 ReadyState getReadyState() const; |
| 144 bool seeking() const; | 144 bool seeking() const; |
| 145 | 145 |
| 146 // playback state | 146 // playback state |
| 147 double currentTime() const; | 147 double currentTime() const; |
| 148 void setCurrentTime(double); | 148 void setCurrentTime(double); |
| 149 double duration() const; | 149 double duration() const; |
| 150 bool paused() const; | 150 bool paused() const; |
| 151 double defaultPlaybackRate() const; | 151 double defaultPlaybackRate() const; |
| 152 void setDefaultPlaybackRate(double); | 152 void setDefaultPlaybackRate(double); |
| (...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 452 enum DirectionOfPlayback { Backward, Forward }; | 452 enum DirectionOfPlayback { Backward, Forward }; |
| 453 DirectionOfPlayback getDirectionOfPlayback() const; | 453 DirectionOfPlayback getDirectionOfPlayback() const; |
| 454 | 454 |
| 455 // Creates placeholder AudioTrack and/or VideoTrack objects when WebMemediaP
layer objects | 455 // Creates placeholder AudioTrack and/or VideoTrack objects when WebMemediaP
layer objects |
| 456 // advertise they have audio and/or video, but don't explicitly signal them
via | 456 // advertise they have audio and/or video, but don't explicitly signal them
via |
| 457 // addAudioTrack() and addVideoTrack(). | 457 // addAudioTrack() and addVideoTrack(). |
| 458 // FIXME: Remove this once all WebMediaPlayer implementations properly repor
t their track info. | 458 // FIXME: Remove this once all WebMediaPlayer implementations properly repor
t their track info. |
| 459 void createPlaceholderTracksIfNecessary(); | 459 void createPlaceholderTracksIfNecessary(); |
| 460 | 460 |
| 461 // Sets the selected/enabled tracks if they aren't set before we initially | 461 // Sets the selected/enabled tracks if they aren't set before we initially |
| 462 // transition to HAVE_METADATA. | 462 // transition to kHaveMetadata. |
| 463 void selectInitialTracksIfNecessary(); | 463 void selectInitialTracksIfNecessary(); |
| 464 | 464 |
| 465 // Return true if and only if a user gesture is required to unlock this | 465 // Return true if and only if a user gesture is required to unlock this |
| 466 // media element for unrestricted autoplay / script control. Don't confuse | 466 // media element for unrestricted autoplay / script control. Don't confuse |
| 467 // this with isGestureNeededForPlayback(). The latter is usually what one | 467 // this with isGestureNeededForPlayback(). The latter is usually what one |
| 468 // should use, if checking to see if an action is allowed. | 468 // should use, if checking to see if an action is allowed. |
| 469 bool isLockedPendingUserGesture() const; | 469 bool isLockedPendingUserGesture() const; |
| 470 | 470 |
| 471 // If the user gesture is required, then this will remove it. Note that | 471 // If the user gesture is required, then this will remove it. Note that |
| 472 // one should not generally call this method directly; use the one on | 472 // one should not generally call this method directly; use the one on |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 563 DeferredLoadState m_deferredLoadState; | 563 DeferredLoadState m_deferredLoadState; |
| 564 Timer<HTMLMediaElement> m_deferredLoadTimer; | 564 Timer<HTMLMediaElement> m_deferredLoadTimer; |
| 565 | 565 |
| 566 std::unique_ptr<WebMediaPlayer> m_webMediaPlayer; | 566 std::unique_ptr<WebMediaPlayer> m_webMediaPlayer; |
| 567 WebLayer* m_webLayer; | 567 WebLayer* m_webLayer; |
| 568 | 568 |
| 569 DisplayMode m_displayMode; | 569 DisplayMode m_displayMode; |
| 570 | 570 |
| 571 Member<HTMLMediaSource> m_mediaSource; | 571 Member<HTMLMediaSource> m_mediaSource; |
| 572 | 572 |
| 573 // Cached time value. Only valid when ready state is HAVE_METADATA or | 573 // Cached time value. Only valid when ready state is kHaveMetadata or |
| 574 // higher, otherwise the current time is assumed to be zero. | 574 // higher, otherwise the current time is assumed to be zero. |
| 575 mutable double m_cachedTime; | 575 mutable double m_cachedTime; |
| 576 | 576 |
| 577 double m_fragmentEndTime; | 577 double m_fragmentEndTime; |
| 578 | 578 |
| 579 typedef unsigned PendingActionFlags; | 579 typedef unsigned PendingActionFlags; |
| 580 PendingActionFlags m_pendingActionFlags; | 580 PendingActionFlags m_pendingActionFlags; |
| 581 | 581 |
| 582 // FIXME: HTMLMediaElement has way too many state bits. | 582 // FIXME: HTMLMediaElement has way too many state bits. |
| 583 bool m_lockedPendingUserGesture : 1; | 583 bool m_lockedPendingUserGesture : 1; |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 693 inline bool isHTMLMediaElement(const HTMLElement& element) | 693 inline bool isHTMLMediaElement(const HTMLElement& element) |
| 694 { | 694 { |
| 695 return isHTMLAudioElement(element) || isHTMLVideoElement(element); | 695 return isHTMLAudioElement(element) || isHTMLVideoElement(element); |
| 696 } | 696 } |
| 697 | 697 |
| 698 DEFINE_HTMLELEMENT_TYPE_CASTS_WITH_FUNCTION(HTMLMediaElement); | 698 DEFINE_HTMLELEMENT_TYPE_CASTS_WITH_FUNCTION(HTMLMediaElement); |
| 699 | 699 |
| 700 } // namespace blink | 700 } // namespace blink |
| 701 | 701 |
| 702 #endif // HTMLMediaElement_h | 702 #endif // HTMLMediaElement_h |
| OLD | NEW |