// But it can't be until the Chromium WebMediaPlayerClientImpl class is fixed so it
// no longer depends on typecasting a MediaPlayerClient to an HTMLMediaElement.
-class HTMLMediaElement : public HTMLElement, public WillBeHeapSupplementable<HTMLMediaElement>, public MediaPlayerClient, public ActiveDOMObject
-{
+class HTMLMediaElement : public HTMLElement, public WillBeHeapSupplementable<HTMLMediaElement>, public MediaPlayerClient, public ActiveDOMObject {
+ DEFINE_WRAPPERTYPEINFO();
WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(HTMLMediaElement);
public:
static blink::WebMimeRegistry::SupportsType supportsType(const ContentType&, const String& keySystem = String());
#if ENABLE(WEB_AUDIO)
void clearWeakMembers(Visitor*);
#endif
-
- // Do not use player().
- // FIXME: Replace all uses with webMediaPlayer() and remove this API.
- MediaPlayer* player() const { return m_player.get(); }
blink::WebMediaPlayer* webMediaPlayer() const { return m_player ? m_player->webMediaPlayer() : 0; }
virtual bool hasVideo() const { return false; }
bool isActive() const { return m_active; }
+ bool hasRemoteRoutes() const { return m_remoteRoutesAvailable; }
+ bool isPlayingRemotely() const { return m_playingRemotely; }
+
// error state
PassRefPtrWillBeRawPtr<MediaError> error() const;
bool ended() const;
bool autoplay() const;
bool loop() const;
- void setLoop(bool b);
+ void setLoop(bool);
void play();
void pause();
+ void requestRemotePlayback();
+ void requestRemotePlaybackControl();
// statistics
unsigned webkitAudioDecodedByteCount() const;
void addTextTrack(TextTrack*);
void removeTextTrack(TextTrack*);
- void closeCaptionTracksChanged();
+ void textTracksChanged();
void notifyMediaPlayerOfTextTrackChanges();
// Implements the "forget the media element's media-resource-specific tracks" algorithm in the HTML5 spec.
bool closedCaptionsVisible() const;
void setClosedCaptionsVisible(bool);
+ void remoteRouteAvailabilityChanged(bool);
+ void connectedToRemoteDevice();
+ void disconnectedFromRemoteDevice();
+
MediaControls* mediaControls() const;
void sourceWasRemoved(HTMLSourceElement*);
void sourceWasAdded(HTMLSourceElement*);
- bool isPlaying() const { return m_playing; }
-
// ActiveDOMObject functions.
virtual bool hasPendingActivity() const OVERRIDE FINAL;
virtual void contextDestroyed() OVERRIDE FINAL;
void setCloseMediaSourceWhenFinalizing();
#endif
+ // Predicates also used when dispatching wrapper creation (cf. [SpecialWrapFor] IDL attribute usage.)
+ virtual bool isHTMLAudioElement() const { return false; }
+ virtual bool isHTMLVideoElement() const { return false; }
+
protected:
HTMLMediaElement(const QualifiedName&, Document&);
virtual ~HTMLMediaElement();
void startProgressEventTimer();
void stopPeriodicTimers();
- void seek(double time, ExceptionState&);
+ void seek(double time);
void finishSeek();
void checkIfSeekNeeded();
void addPlayedRange(double start, double end);
bool stoppedDueToErrors() const;
bool couldPlayIfEnoughData() const;
- // Pauses playback without changing any states or generating events
- void setPausedInternal(bool);
-
void setShouldDelayLoadEvent(bool);
void invalidateCachedTime();
void refreshCachedTime() const;
bool createMediaControls();
void configureMediaControls();
- void prepareMediaFragmentURI();
- void applyMediaFragmentURI();
-
virtual void* preDispatchEventHandler(Event*) OVERRIDE FINAL;
void changeNetworkStateFromLoadingToIdle();
// The last time a timeupdate event was sent in movie time.
double m_lastTimeUpdateEventMovieTime;
+ // The default playback start position.
+ double m_defaultPlaybackStartPosition;
+
// Loading state.
enum LoadState { WaitingForSource, LoadingFromSrcAttr, LoadingFromSourceElement };
LoadState m_loadState;
RefPtrWillBeMember<HTMLMediaSource> m_mediaSource;
+ // Cached time value. Only valid when ready state is HAVE_METADATA or
+ // higher, otherwise the current time is assumed to be zero.
mutable double m_cachedTime;
- mutable double m_cachedTimeWallClockUpdateTime;
- mutable double m_minimumWallClockTimeToCacheMediaTime;
- double m_fragmentStartTime;
double m_fragmentEndTime;
typedef unsigned PendingActionFlags;
// time has not changed since sending an "ended" event
bool m_sentEndEvent : 1;
- bool m_pausedInternal : 1;
-
bool m_closedCaptionsVisible : 1;
bool m_completelyLoaded : 1;
bool m_tracksAreReady : 1;
bool m_haveVisibleTextTrack : 1;
bool m_processingPreferenceChange : 1;
+ bool m_remoteRoutesAvailable : 1;
+ bool m_playingRemotely : 1;
#if ENABLE(OILPAN)
bool m_isFinalizing : 1;
bool m_closeMediaSourceWhenFinalizing : 1;
#if ENABLE(WEB_AUDIO)
// This is a weak reference, since m_audioSourceNode holds a reference to us.
// FIXME: Oilpan: Consider making this a strongly traced pointer with oilpan where strong cycles are not a problem.
+ GC_PLUGIN_IGNORE("http://crbug.com/404577")
RawPtrWillBeWeakMember<AudioSourceProviderClient> m_audioSourceNode;
#endif
DEFINE_HTMLELEMENT_TYPE_CASTS_WITH_FUNCTION(HTMLMediaElement);
-} //namespace
+} // namespace blink
-#endif
+#endif // HTMLMediaElement_h