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 11 matching lines...) Expand all Loading... |
22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
24 */ | 24 */ |
25 | 25 |
26 #ifndef HTMLMediaElement_h | 26 #ifndef HTMLMediaElement_h |
27 #define HTMLMediaElement_h | 27 #define HTMLMediaElement_h |
28 | 28 |
29 #include "core/dom/ActiveDOMObject.h" | 29 #include "core/dom/ActiveDOMObject.h" |
30 #include "core/events/GenericEventQueue.h" | 30 #include "core/events/GenericEventQueue.h" |
31 #include "core/html/HTMLElement.h" | 31 #include "core/html/HTMLElement.h" |
32 #include "core/html/MediaControllerInterface.h" | |
33 #include "core/html/track/TextTrack.h" | 32 #include "core/html/track/TextTrack.h" |
34 #include "core/html/track/TextTrackCue.h" | 33 #include "core/html/track/TextTrackCue.h" |
35 #include "core/html/track/vtt/VTTCue.h" | 34 #include "core/html/track/vtt/VTTCue.h" |
36 #include "platform/PODIntervalTree.h" | 35 #include "platform/PODIntervalTree.h" |
37 #include "platform/graphics/media/MediaPlayer.h" | 36 #include "platform/graphics/media/MediaPlayer.h" |
38 #include "public/platform/WebMimeRegistry.h" | 37 #include "public/platform/WebMimeRegistry.h" |
39 | 38 |
40 namespace blink { | 39 namespace blink { |
41 class WebContentDecryptionModule; | 40 class WebContentDecryptionModule; |
42 class WebInbandTextTrack; | 41 class WebInbandTextTrack; |
(...skipping 21 matching lines...) Expand all Loading... |
64 class URLRegistry; | 63 class URLRegistry; |
65 | 64 |
66 typedef PODIntervalTree<double, TextTrackCue*> CueIntervalTree; | 65 typedef PODIntervalTree<double, TextTrackCue*> CueIntervalTree; |
67 typedef CueIntervalTree::IntervalType CueInterval; | 66 typedef CueIntervalTree::IntervalType CueInterval; |
68 typedef Vector<CueInterval> CueList; | 67 typedef Vector<CueInterval> CueList; |
69 | 68 |
70 // FIXME: The inheritance from MediaPlayerClient here should be private inherita
nce. | 69 // FIXME: The inheritance from MediaPlayerClient here should be private inherita
nce. |
71 // But it can't be until the Chromium WebMediaPlayerClientImpl class is fixed so
it | 70 // But it can't be until the Chromium WebMediaPlayerClientImpl class is fixed so
it |
72 // no longer depends on typecasting a MediaPlayerClient to an HTMLMediaElement. | 71 // no longer depends on typecasting a MediaPlayerClient to an HTMLMediaElement. |
73 | 72 |
74 class HTMLMediaElement : public Supplementable<HTMLMediaElement>, public HTMLEle
ment, public MediaPlayerClient, public ActiveDOMObject, public MediaControllerIn
terface | 73 class HTMLMediaElement : public Supplementable<HTMLMediaElement>, public HTMLEle
ment, public MediaPlayerClient, public ActiveDOMObject |
75 { | 74 { |
76 public: | 75 public: |
77 static blink::WebMimeRegistry::SupportsType supportsType(const ContentType&,
const String& keySystem = String()); | 76 static blink::WebMimeRegistry::SupportsType supportsType(const ContentType&,
const String& keySystem = String()); |
78 | 77 |
79 static void setMediaStreamRegistry(URLRegistry*); | 78 static void setMediaStreamRegistry(URLRegistry*); |
80 static bool isMediaStreamURL(const String& url); | 79 static bool isMediaStreamURL(const String& url); |
81 | 80 |
82 // Do not use player(). | 81 // Do not use player(). |
83 // FIXME: Replace all uses with webMediaPlayer() and remove this API. | 82 // FIXME: Replace all uses with webMediaPlayer() and remove this API. |
84 MediaPlayer* player() const { return m_player.get(); } | 83 MediaPlayer* player() const { return m_player.get(); } |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
116 PassRefPtr<TimeRanges> buffered() const; | 115 PassRefPtr<TimeRanges> buffered() const; |
117 void load(); | 116 void load(); |
118 String canPlayType(const String& mimeType, const String& keySystem = String(
)) const; | 117 String canPlayType(const String& mimeType, const String& keySystem = String(
)) const; |
119 | 118 |
120 // ready state | 119 // ready state |
121 enum ReadyState { HAVE_NOTHING, HAVE_METADATA, HAVE_CURRENT_DATA, HAVE_FUTUR
E_DATA, HAVE_ENOUGH_DATA }; | 120 enum ReadyState { HAVE_NOTHING, HAVE_METADATA, HAVE_CURRENT_DATA, HAVE_FUTUR
E_DATA, HAVE_ENOUGH_DATA }; |
122 ReadyState readyState() const; | 121 ReadyState readyState() const; |
123 bool seeking() const; | 122 bool seeking() const; |
124 | 123 |
125 // playback state | 124 // playback state |
126 virtual double currentTime() const OVERRIDE FINAL; | 125 double currentTime() const; |
127 virtual void setCurrentTime(double, ExceptionState&) OVERRIDE FINAL; | 126 void setCurrentTime(double, ExceptionState&); |
128 virtual double duration() const OVERRIDE FINAL; | 127 double duration() const; |
129 bool paused() const; | 128 bool paused() const; |
130 double defaultPlaybackRate() const; | 129 double defaultPlaybackRate() const; |
131 void setDefaultPlaybackRate(double); | 130 void setDefaultPlaybackRate(double); |
132 double playbackRate() const; | 131 double playbackRate() const; |
133 void setPlaybackRate(double); | 132 void setPlaybackRate(double); |
134 void updatePlaybackRate(); | 133 void updatePlaybackRate(); |
135 PassRefPtr<TimeRanges> played(); | 134 PassRefPtr<TimeRanges> played(); |
136 PassRefPtr<TimeRanges> seekable() const; | 135 PassRefPtr<TimeRanges> seekable() const; |
137 bool ended() const; | 136 bool ended() const; |
138 bool autoplay() const; | 137 bool autoplay() const; |
(...skipping 416 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
555 inline bool isHTMLMediaElement(const HTMLElement& element) | 554 inline bool isHTMLMediaElement(const HTMLElement& element) |
556 { | 555 { |
557 return isHTMLAudioElement(element) || isHTMLVideoElement(element); | 556 return isHTMLAudioElement(element) || isHTMLVideoElement(element); |
558 } | 557 } |
559 | 558 |
560 DEFINE_HTMLELEMENT_TYPE_CASTS_WITH_FUNCTION(HTMLMediaElement); | 559 DEFINE_HTMLELEMENT_TYPE_CASTS_WITH_FUNCTION(HTMLMediaElement); |
561 | 560 |
562 } //namespace | 561 } //namespace |
563 | 562 |
564 #endif | 563 #endif |
OLD | NEW |