OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. All rights | 2 * Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. All rights |
3 * reserved. | 3 * reserved. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
7 * are met: | 7 * are met: |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 class CueTimeline; | 56 class CueTimeline; |
57 class ElementVisibilityObserver; | 57 class ElementVisibilityObserver; |
58 class EnumerationHistogram; | 58 class EnumerationHistogram; |
59 class Event; | 59 class Event; |
60 class ExceptionState; | 60 class ExceptionState; |
61 class HTMLSourceElement; | 61 class HTMLSourceElement; |
62 class HTMLTrackElement; | 62 class HTMLTrackElement; |
63 class KURL; | 63 class KURL; |
64 class MediaControls; | 64 class MediaControls; |
65 class MediaError; | 65 class MediaError; |
| 66 class MediaRemotingInterstitial; |
66 class MediaStreamDescriptor; | 67 class MediaStreamDescriptor; |
67 class HTMLMediaSource; | 68 class HTMLMediaSource; |
68 class ScriptState; | 69 class ScriptState; |
69 class TextTrackContainer; | 70 class TextTrackContainer; |
70 class TextTrackList; | 71 class TextTrackList; |
71 class TimeRanges; | 72 class TimeRanges; |
72 class URLRegistry; | 73 class URLRegistry; |
73 class VideoTrack; | 74 class VideoTrack; |
74 class VideoTrackList; | 75 class VideoTrackList; |
75 class WebAudioSourceProvider; | 76 class WebAudioSourceProvider; |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
123 WebLayer* platformLayer() const; | 124 WebLayer* platformLayer() const; |
124 | 125 |
125 enum DelayedActionType { | 126 enum DelayedActionType { |
126 LoadMediaResource = 1 << 0, | 127 LoadMediaResource = 1 << 0, |
127 LoadTextTrackResource = 1 << 1 | 128 LoadTextTrackResource = 1 << 1 |
128 }; | 129 }; |
129 void scheduleTextTrackResourceLoad(); | 130 void scheduleTextTrackResourceLoad(); |
130 | 131 |
131 bool hasRemoteRoutes() const; | 132 bool hasRemoteRoutes() const; |
132 bool isPlayingRemotely() const { return m_playingRemotely; } | 133 bool isPlayingRemotely() const { return m_playingRemotely; } |
| 134 bool isMediaRemotingStarted() const { return m_mediaRemotingStarted; } |
133 | 135 |
134 // error state | 136 // error state |
135 MediaError* error() const; | 137 MediaError* error() const; |
136 | 138 |
137 // network state | 139 // network state |
138 void setSrc(const AtomicString&); | 140 void setSrc(const AtomicString&); |
139 const KURL& currentSrc() const { return m_currentSrc; } | 141 const KURL& currentSrc() const { return m_currentSrc; } |
140 void setSrcObject(MediaStreamDescriptor*); | 142 void setSrcObject(MediaStreamDescriptor*); |
141 MediaStreamDescriptor* getSrcObject() const { return m_srcObject.get(); } | 143 MediaStreamDescriptor* getSrcObject() const { return m_srcObject.get(); } |
142 | 144 |
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
316 | 318 |
317 void videoWillBeDrawnToCanvas() const; | 319 void videoWillBeDrawnToCanvas() const; |
318 | 320 |
319 WebRemotePlaybackClient* remotePlaybackClient() { | 321 WebRemotePlaybackClient* remotePlaybackClient() { |
320 return m_remotePlaybackClient; | 322 return m_remotePlaybackClient; |
321 } | 323 } |
322 const WebRemotePlaybackClient* remotePlaybackClient() const { | 324 const WebRemotePlaybackClient* remotePlaybackClient() const { |
323 return m_remotePlaybackClient; | 325 return m_remotePlaybackClient; |
324 } | 326 } |
325 | 327 |
| 328 void disableMediaRemoting(); |
| 329 |
326 protected: | 330 protected: |
327 HTMLMediaElement(const QualifiedName&, Document&); | 331 HTMLMediaElement(const QualifiedName&, Document&); |
328 ~HTMLMediaElement() override; | 332 ~HTMLMediaElement() override; |
329 void dispose(); | 333 void dispose(); |
330 | 334 |
331 void parseAttribute(const AttributeModificationParams&) override; | 335 void parseAttribute(const AttributeModificationParams&) override; |
332 void finishParsingChildren() final; | 336 void finishParsingChildren() final; |
333 bool isURLAttribute(const Attribute&) const override; | 337 bool isURLAttribute(const Attribute&) const override; |
334 void attachLayoutTree(const AttachContext& = AttachContext()) override; | 338 void attachLayoutTree(const AttachContext& = AttachContext()) override; |
335 | 339 |
336 InsertionNotificationRequest insertedInto(ContainerNode*) override; | 340 InsertionNotificationRequest insertedInto(ContainerNode*) override; |
337 void removedFrom(ContainerNode*) override; | 341 void removedFrom(ContainerNode*) override; |
338 | 342 |
339 void didMoveToNewDocument(Document& oldDocument) override; | 343 void didMoveToNewDocument(Document& oldDocument) override; |
340 virtual KURL posterImageURL() const { return KURL(); } | 344 virtual KURL posterImageURL() const { return KURL(); } |
341 | 345 |
342 enum DisplayMode { Unknown, Poster, Video }; | 346 enum DisplayMode { Unknown, Poster, Video }; |
343 DisplayMode getDisplayMode() const { return m_displayMode; } | 347 DisplayMode getDisplayMode() const { return m_displayMode; } |
344 virtual void setDisplayMode(DisplayMode mode) { m_displayMode = mode; } | 348 virtual void setDisplayMode(DisplayMode mode) { m_displayMode = mode; } |
345 | 349 |
| 350 void onPosterImageChanged(); |
| 351 |
346 private: | 352 private: |
347 // Friend class for testing. | 353 // Friend class for testing. |
348 friend class MediaElementFillingViewportTest; | 354 friend class MediaElementFillingViewportTest; |
349 | 355 |
350 void resetMediaPlayerAndMediaSource(); | 356 void resetMediaPlayerAndMediaSource(); |
351 | 357 |
352 bool alwaysCreateUserAgentShadowRoot() const final { return true; } | 358 bool alwaysCreateUserAgentShadowRoot() const final { return true; } |
353 bool areAuthorShadowsAllowed() const final { return false; } | 359 bool areAuthorShadowsAllowed() const final { return false; } |
354 | 360 |
355 bool supportsFocus() const final; | 361 bool supportsFocus() const final; |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
401 void connectedToRemoteDevice() final; | 407 void connectedToRemoteDevice() final; |
402 void disconnectedFromRemoteDevice() final; | 408 void disconnectedFromRemoteDevice() final; |
403 void cancelledRemotePlaybackRequest() final; | 409 void cancelledRemotePlaybackRequest() final; |
404 void remotePlaybackStarted() final; | 410 void remotePlaybackStarted() final; |
405 void onBecamePersistentVideo(bool) final; | 411 void onBecamePersistentVideo(bool) final; |
406 bool hasSelectedVideoTrack() final; | 412 bool hasSelectedVideoTrack() final; |
407 WebMediaPlayer::TrackId getSelectedVideoTrackId() final; | 413 WebMediaPlayer::TrackId getSelectedVideoTrackId() final; |
408 bool isAutoplayingMuted() final; | 414 bool isAutoplayingMuted() final; |
409 void requestReload(const WebURL&) final; | 415 void requestReload(const WebURL&) final; |
410 void activateViewportIntersectionMonitoring(bool) final; | 416 void activateViewportIntersectionMonitoring(bool) final; |
| 417 void mediaRemotingStarted() final; |
| 418 void mediaRemotingStopped() final; |
411 | 419 |
412 void loadTimerFired(TimerBase*); | 420 void loadTimerFired(TimerBase*); |
413 void progressEventTimerFired(TimerBase*); | 421 void progressEventTimerFired(TimerBase*); |
414 void playbackProgressTimerFired(TimerBase*); | 422 void playbackProgressTimerFired(TimerBase*); |
415 void checkViewportIntersectionTimerFired(TimerBase*); | 423 void checkViewportIntersectionTimerFired(TimerBase*); |
416 void startPlaybackProgressTimer(); | 424 void startPlaybackProgressTimer(); |
417 void startProgressEventTimer(); | 425 void startProgressEventTimer(); |
418 void stopPeriodicTimers(); | 426 void stopPeriodicTimers(); |
419 | 427 |
420 void seek(double time); | 428 void seek(double time); |
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
661 bool m_shouldPerformAutomaticTrackSelection : 1; | 669 bool m_shouldPerformAutomaticTrackSelection : 1; |
662 | 670 |
663 bool m_tracksAreReady : 1; | 671 bool m_tracksAreReady : 1; |
664 bool m_processingPreferenceChange : 1; | 672 bool m_processingPreferenceChange : 1; |
665 bool m_playingRemotely : 1; | 673 bool m_playingRemotely : 1; |
666 // Whether this element is in overlay fullscreen mode. | 674 // Whether this element is in overlay fullscreen mode. |
667 bool m_inOverlayFullscreenVideo : 1; | 675 bool m_inOverlayFullscreenVideo : 1; |
668 | 676 |
669 bool m_mostlyFillingViewport : 1; | 677 bool m_mostlyFillingViewport : 1; |
670 | 678 |
| 679 bool m_mediaRemotingDisabled : 1; |
| 680 |
| 681 bool m_mediaRemotingStarted : 1; |
| 682 |
671 TraceWrapperMember<AudioTrackList> m_audioTracks; | 683 TraceWrapperMember<AudioTrackList> m_audioTracks; |
672 TraceWrapperMember<VideoTrackList> m_videoTracks; | 684 TraceWrapperMember<VideoTrackList> m_videoTracks; |
673 TraceWrapperMember<TextTrackList> m_textTracks; | 685 TraceWrapperMember<TextTrackList> m_textTracks; |
674 HeapVector<Member<TextTrack>> m_textTracksWhenResourceSelectionBegan; | 686 HeapVector<Member<TextTrack>> m_textTracksWhenResourceSelectionBegan; |
675 | 687 |
676 Member<CueTimeline> m_cueTimeline; | 688 Member<CueTimeline> m_cueTimeline; |
677 | 689 |
678 HeapVector<Member<ScriptPromiseResolver>> m_playPromiseResolvers; | 690 HeapVector<Member<ScriptPromiseResolver>> m_playPromiseResolvers; |
679 TaskHandle m_playPromiseResolveTaskHandle; | 691 TaskHandle m_playPromiseResolveTaskHandle; |
680 TaskHandle m_playPromiseRejectTaskHandle; | 692 TaskHandle m_playPromiseRejectTaskHandle; |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
751 | 763 |
752 WebRemotePlaybackClient* m_remotePlaybackClient; | 764 WebRemotePlaybackClient* m_remotePlaybackClient; |
753 | 765 |
754 // class AutoplayVisibilityObserver; | 766 // class AutoplayVisibilityObserver; |
755 Member<ElementVisibilityObserver> m_autoplayVisibilityObserver; | 767 Member<ElementVisibilityObserver> m_autoplayVisibilityObserver; |
756 | 768 |
757 IntRect m_currentIntersectRect; | 769 IntRect m_currentIntersectRect; |
758 | 770 |
759 Member<MediaControls> m_mediaControls; | 771 Member<MediaControls> m_mediaControls; |
760 Member<HTMLMediaElementControlsList> m_controlsList; | 772 Member<HTMLMediaElementControlsList> m_controlsList; |
| 773 Member<MediaRemotingInterstitial> m_remotingInterstitial; |
761 | 774 |
762 bool m_isPersistentVideo; | 775 bool m_isPersistentVideo; |
763 | 776 |
764 static URLRegistry* s_mediaStreamRegistry; | 777 static URLRegistry* s_mediaStreamRegistry; |
765 }; | 778 }; |
766 | 779 |
767 inline bool isHTMLMediaElement(const HTMLElement& element) { | 780 inline bool isHTMLMediaElement(const HTMLElement& element) { |
768 return isHTMLAudioElement(element) || isHTMLVideoElement(element); | 781 return isHTMLAudioElement(element) || isHTMLVideoElement(element); |
769 } | 782 } |
770 | 783 |
771 DEFINE_HTMLELEMENT_TYPE_CASTS_WITH_FUNCTION(HTMLMediaElement); | 784 DEFINE_HTMLELEMENT_TYPE_CASTS_WITH_FUNCTION(HTMLMediaElement); |
772 | 785 |
773 } // namespace blink | 786 } // namespace blink |
774 | 787 |
775 #endif // HTMLMediaElement_h | 788 #endif // HTMLMediaElement_h |
OLD | NEW |