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 19 matching lines...) Expand all Loading... |
30 #include <memory> | 30 #include <memory> |
31 #include "bindings/core/v8/ActiveScriptWrappable.h" | 31 #include "bindings/core/v8/ActiveScriptWrappable.h" |
32 #include "bindings/core/v8/Nullable.h" | 32 #include "bindings/core/v8/Nullable.h" |
33 #include "bindings/core/v8/ScriptPromise.h" | 33 #include "bindings/core/v8/ScriptPromise.h" |
34 #include "bindings/core/v8/TraceWrapperMember.h" | 34 #include "bindings/core/v8/TraceWrapperMember.h" |
35 #include "core/CoreExport.h" | 35 #include "core/CoreExport.h" |
36 #include "core/dom/ExceptionCode.h" | 36 #include "core/dom/ExceptionCode.h" |
37 #include "core/dom/SuspendableObject.h" | 37 #include "core/dom/SuspendableObject.h" |
38 #include "core/events/GenericEventQueue.h" | 38 #include "core/events/GenericEventQueue.h" |
39 #include "core/html/HTMLElement.h" | 39 #include "core/html/HTMLElement.h" |
| 40 #include "core/html/media/MediaControls.h" |
40 #include "core/html/track/TextTrack.h" | 41 #include "core/html/track/TextTrack.h" |
41 #include "platform/Supplementable.h" | 42 #include "platform/Supplementable.h" |
42 #include "platform/WebTaskRunner.h" | 43 #include "platform/WebTaskRunner.h" |
43 #include "platform/audio/AudioSourceProvider.h" | 44 #include "platform/audio/AudioSourceProvider.h" |
44 #include "platform/network/mime/MIMETypeRegistry.h" | 45 #include "platform/network/mime/MIMETypeRegistry.h" |
45 #include "public/platform/WebAudioSourceProviderClient.h" | 46 #include "public/platform/WebAudioSourceProviderClient.h" |
46 #include "public/platform/WebMediaPlayerClient.h" | 47 #include "public/platform/WebMediaPlayerClient.h" |
47 | 48 |
48 namespace blink { | 49 namespace blink { |
49 | 50 |
50 class AudioSourceProviderClient; | 51 class AudioSourceProviderClient; |
51 class AudioTrack; | 52 class AudioTrack; |
52 class AudioTrackList; | 53 class AudioTrackList; |
53 class AutoplayUmaHelper; | 54 class AutoplayUmaHelper; |
54 class ContentType; | 55 class ContentType; |
55 class CueTimeline; | 56 class CueTimeline; |
56 class ElementVisibilityObserver; | 57 class ElementVisibilityObserver; |
57 class EnumerationHistogram; | 58 class EnumerationHistogram; |
58 class Event; | 59 class Event; |
59 class ExceptionState; | 60 class ExceptionState; |
60 class HTMLMediaElementControlsList; | 61 class HTMLMediaElementControlsList; |
61 class HTMLSourceElement; | 62 class HTMLSourceElement; |
62 class HTMLTrackElement; | 63 class HTMLTrackElement; |
63 class KURL; | 64 class KURL; |
64 class MediaControls; | |
65 class MediaError; | 65 class MediaError; |
66 class MediaStreamDescriptor; | 66 class MediaStreamDescriptor; |
67 class HTMLMediaSource; | 67 class HTMLMediaSource; |
68 class ScriptState; | 68 class ScriptState; |
69 class TextTrackContainer; | 69 class TextTrackContainer; |
70 class TextTrackList; | 70 class TextTrackList; |
71 class TimeRanges; | 71 class TimeRanges; |
72 class URLRegistry; | 72 class URLRegistry; |
73 class VideoTrack; | 73 class VideoTrack; |
74 class VideoTrackList; | 74 class VideoTrackList; |
(...skipping 22 matching lines...) Expand all Loading... |
97 static bool isHLSURL(const KURL&); | 97 static bool isHLSURL(const KURL&); |
98 | 98 |
99 // If HTMLMediaElement is using MediaTracks (either placeholder or provided | 99 // If HTMLMediaElement is using MediaTracks (either placeholder or provided |
100 // by the page). | 100 // by the page). |
101 static bool mediaTracksEnabledInternally(); | 101 static bool mediaTracksEnabledInternally(); |
102 | 102 |
103 // Notify the HTMLMediaElement that the media controls settings have changed | 103 // Notify the HTMLMediaElement that the media controls settings have changed |
104 // for the given document. | 104 // for the given document. |
105 static void onMediaControlsEnabledChange(Document*); | 105 static void onMediaControlsEnabledChange(Document*); |
106 | 106 |
| 107 // Called by the module implementing the media controls to notify of the |
| 108 // factory to use. It should only be called once at process initialisation. |
| 109 static void registerMediaControlsFactory( |
| 110 std::unique_ptr<MediaControls::Factory>); |
| 111 |
107 DECLARE_VIRTUAL_TRACE(); | 112 DECLARE_VIRTUAL_TRACE(); |
108 | 113 |
109 DECLARE_VIRTUAL_TRACE_WRAPPERS(); | 114 DECLARE_VIRTUAL_TRACE_WRAPPERS(); |
110 | 115 |
111 void clearWeakMembers(Visitor*); | 116 void clearWeakMembers(Visitor*); |
112 WebMediaPlayer* webMediaPlayer() const { return m_webMediaPlayer.get(); } | 117 WebMediaPlayer* webMediaPlayer() const { return m_webMediaPlayer.get(); } |
113 | 118 |
114 // Returns true if the loaded media has a video track. | 119 // Returns true if the loaded media has a video track. |
115 // Note that even an audio element can have video track in cases such as | 120 // Note that even an audio element can have video track in cases such as |
116 // <audio src="video.webm">, in which case this function will return true. | 121 // <audio src="video.webm">, in which case this function will return true. |
(...skipping 616 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
733 Member<AudioClientImpl> m_client; | 738 Member<AudioClientImpl> m_client; |
734 Mutex provideInputLock; | 739 Mutex provideInputLock; |
735 }; | 740 }; |
736 | 741 |
737 AudioSourceProviderImpl m_audioSourceProvider; | 742 AudioSourceProviderImpl m_audioSourceProvider; |
738 | 743 |
739 friend class AutoplayUmaHelper; // for isAutoplayAllowedPerSettings | 744 friend class AutoplayUmaHelper; // for isAutoplayAllowedPerSettings |
740 friend class AutoplayUmaHelperTest; | 745 friend class AutoplayUmaHelperTest; |
741 friend class Internals; | 746 friend class Internals; |
742 friend class TrackDisplayUpdateScope; | 747 friend class TrackDisplayUpdateScope; |
743 friend class MediaControlsTest; | 748 friend class MediaControlsImplTest; |
744 friend class HTMLMediaElementTest; | 749 friend class HTMLMediaElementTest; |
745 friend class HTMLMediaElementEventListenersTest; | 750 friend class HTMLMediaElementEventListenersTest; |
746 friend class HTMLVideoElement; | 751 friend class HTMLVideoElement; |
747 friend class MediaControlsOrientationLockDelegateTest; | 752 friend class MediaControlsOrientationLockDelegateTest; |
748 | 753 |
749 Member<AutoplayUmaHelper> m_autoplayUmaHelper; | 754 Member<AutoplayUmaHelper> m_autoplayUmaHelper; |
750 | 755 |
751 WebRemotePlaybackClient* m_remotePlaybackClient; | 756 WebRemotePlaybackClient* m_remotePlaybackClient; |
752 | 757 |
753 // class AutoplayVisibilityObserver; | 758 // class AutoplayVisibilityObserver; |
754 Member<ElementVisibilityObserver> m_autoplayVisibilityObserver; | 759 Member<ElementVisibilityObserver> m_autoplayVisibilityObserver; |
755 | 760 |
756 IntRect m_currentIntersectRect; | 761 IntRect m_currentIntersectRect; |
757 | 762 |
758 Member<MediaControls> m_mediaControls; | 763 Member<MediaControls> m_mediaControls; |
759 Member<HTMLMediaElementControlsList> m_controlsList; | 764 Member<HTMLMediaElementControlsList> m_controlsList; |
760 | 765 |
761 static URLRegistry* s_mediaStreamRegistry; | 766 static URLRegistry* s_mediaStreamRegistry; |
762 }; | 767 }; |
763 | 768 |
764 inline bool isHTMLMediaElement(const HTMLElement& element) { | 769 inline bool isHTMLMediaElement(const HTMLElement& element) { |
765 return isHTMLAudioElement(element) || isHTMLVideoElement(element); | 770 return isHTMLAudioElement(element) || isHTMLVideoElement(element); |
766 } | 771 } |
767 | 772 |
768 DEFINE_HTMLELEMENT_TYPE_CASTS_WITH_FUNCTION(HTMLMediaElement); | 773 DEFINE_HTMLELEMENT_TYPE_CASTS_WITH_FUNCTION(HTMLMediaElement); |
769 | 774 |
770 } // namespace blink | 775 } // namespace blink |
771 | 776 |
772 #endif // HTMLMediaElement_h | 777 #endif // HTMLMediaElement_h |
OLD | NEW |