Changeset 197204 in webkit
- Timestamp:
- Feb 26, 2016 2:28:23 PM (8 years ago)
- Location:
- trunk/Source
- Files:
-
- 24 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r197194 r197204 1 2016-02-26 Beth Dakin <bdakin@apple.com> 2 3 Add support for playbackControlsManager 4 https://bugs.webkit.org/show_bug.cgi?id=154742 5 -and corresponding- 6 rdar://problem/23833753 7 8 Reviewed by Jer Noble. 9 10 Make AVKitSPI.h private so that it can be used from other projects. 11 * WebCore.xcodeproj/project.pbxproj: 12 13 Right now, set up a controls manager for a video when it starts playing. In 14 the future, this is something that should be handled by the 15 PlatformMediaSessionManager since we only want a controls for the 16 currentSession. 17 * html/HTMLMediaElement.cpp: 18 (WebCore::HTMLMediaElement::playInternal): 19 20 New function setUpVideoControlsManager. 21 * page/ChromeClient.h: 22 23 Make these CoreMedia functions available on Mac and iOS instead of just iOS. 24 * platform/cf/CoreMediaSoftLink.cpp: 25 * platform/cf/CoreMediaSoftLink.h: 26 27 This patch fleshes out an implementation for a bunch of these interface 28 functions since they need to communicate to the playbackControlsManager. This 29 is also where the playbackControlsManager lives. 30 * platform/mac/WebVideoFullscreenInterfaceMac.h: 31 32 Define an interface and implementation for WebPlaybackControlsManager. 33 * platform/mac/WebVideoFullscreenInterfaceMac.mm: 34 (-[WebPlaybackControlsManager initWithWebVideoFullscreenInterfaceMac:]): 35 (-[WebPlaybackControlsManager isSeeking]): 36 (-[WebPlaybackControlsManager seekToTime:toleranceBefore:toleranceAfter:]): 37 (-[WebPlaybackControlsManager audioMediaSelectionOptions]): 38 (-[WebPlaybackControlsManager currentAudioMediaSelectionOption]): 39 (-[WebPlaybackControlsManager setCurrentAudioMediaSelectionOption:]): 40 (-[WebPlaybackControlsManager legibleMediaSelectionOptions]): 41 (-[WebPlaybackControlsManager currentLegibleMediaSelectionOption]): 42 (-[WebPlaybackControlsManager setCurrentLegibleMediaSelectionOption:]): 43 (-[WebPlaybackControlsManager cancelThumbnailAndAudioAmplitudeSampleGeneration]): 44 45 Relay this information to the playbackControlsManager. 46 (WebCore::WebVideoFullscreenInterfaceMac::setDuration): 47 (WebCore::WebVideoFullscreenInterfaceMac::setCurrentTime): 48 (WebCore::WebVideoFullscreenInterfaceMac::setRate): 49 (WebCore::WebVideoFullscreenInterfaceMac::setSeekableRanges): 50 (WebCore::WebVideoFullscreenInterfaceMac::ensureControlsManager): 51 (WebCore::WebVideoFullscreenInterfaceMac::playBackControlsManager): 52 (WebCore::WebVideoFullscreenInterfaceMac::setupFullscreen): 53 54 New SPI needed. 55 * platform/spi/cocoa/AVKitSPI.h: 56 * platform/spi/mac/AVFoundationSPI.h: 57 1 58 2016-02-26 Said Abou-Hallawa <sabouhallawa@apple.com> 2 59 -
trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj
r197142 r197204 330 330 07EE76EF1BEA619800F89133 /* MockRealtimeVideoSourceMac.h in Headers */ = {isa = PBXBuildFile; fileRef = 07EE76ED1BEA619800F89133 /* MockRealtimeVideoSourceMac.h */; }; 331 331 07EE76F01BEA619800F89133 /* MockRealtimeVideoSourceMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 07EE76EE1BEA619800F89133 /* MockRealtimeVideoSourceMac.mm */; }; 332 07F0B97A1AC5DB3300E535D9 /* AVKitSPI.h in Headers */ = {isa = PBXBuildFile; fileRef = 07F0B9791AC5DB3300E535D9 /* AVKitSPI.h */; };332 07F0B97A1AC5DB3300E535D9 /* AVKitSPI.h in Headers */ = {isa = PBXBuildFile; fileRef = 07F0B9791AC5DB3300E535D9 /* AVKitSPI.h */; settings = {ATTRIBUTES = (Private, ); }; }; 333 333 07F0B97C1AC5DB4600E535D9 /* AVFoundationSPI.h in Headers */ = {isa = PBXBuildFile; fileRef = 07F0B97B1AC5DB4600E535D9 /* AVFoundationSPI.h */; settings = {ATTRIBUTES = (Private, ); }; }; 334 334 07F876841AD580F900905849 /* MediaPlaybackTargetContext.h in Headers */ = {isa = PBXBuildFile; fileRef = 07F876831AD4A94500905849 /* MediaPlaybackTargetContext.h */; settings = {ATTRIBUTES = (Private, ); }; }; -
trunk/Source/WebCore/html/HTMLMediaElement.cpp
r197114 r197204 2956 2956 } 2957 2957 2958 // FIXME: rdar://problem/23833752 We need to be more strategic about when we set up the video controls manager. 2959 // It's really something that should be handled by the PlatformMediaSessionManager since we only want a controls 2960 // manager for the currentSession. 2961 if (document().page() && is<HTMLVideoElement>(*this)) { 2962 HTMLVideoElement& asVideo = downcast<HTMLVideoElement>(*this); 2963 document().page()->chrome().client().setUpVideoControlsManager(asVideo); 2964 } 2965 2958 2966 // 4.8.10.9. Playing the media resource 2959 2967 if (!m_player || m_networkState == NETWORK_EMPTY) -
trunk/Source/WebCore/page/ChromeClient.h
r195487 r197204 342 342 #if ENABLE(VIDEO) 343 343 virtual void enterVideoFullscreenForVideoElement(HTMLVideoElement&, HTMLMediaElementEnums::VideoFullscreenMode) { } 344 virtual void setUpVideoControlsManager(HTMLVideoElement&) { } 344 345 #endif 345 346 virtual void exitVideoFullscreenForVideoElement(WebCore::HTMLVideoElement&) { } -
trunk/Source/WebCore/platform/cf/CoreMediaSoftLink.cpp
r189913 r197204 44 44 SOFT_LINK_FUNCTION_FOR_SOURCE(WebCore, CoreMedia, CMTimeMakeWithSeconds, CMTime, (Float64 seconds, int32_t preferredTimeScale), (seconds, preferredTimeScale)) 45 45 SOFT_LINK_FUNCTION_FOR_SOURCE(WebCore, CoreMedia, CMTimeRangeGetEnd, CMTime, (CMTimeRange range), (range)) 46 SOFT_LINK_FUNCTION_FOR_SOURCE(WebCore, CoreMedia, CMTimeRangeMake, CMTimeRange, (CMTime start, CMTime duration), (start, duration)) 46 47 47 48 SOFT_LINK_CONSTANT_FOR_SOURCE(WebCore, CoreMedia, kCMFormatDescriptionExtension_SampleDescriptionExtensionAtoms, CFStringRef) … … 112 113 SOFT_LINK_FUNCTION_FOR_SOURCE(WebCore, CoreMedia, CMTimeMinimum, CMTime, (CMTime time1, CMTime time2), (time1, time2)) 113 114 SOFT_LINK_FUNCTION_FOR_SOURCE(WebCore, CoreMedia, CMTimeRangeContainsTime, Boolean, (CMTimeRange range, CMTime time), (range, time)) 114 SOFT_LINK_FUNCTION_FOR_SOURCE(WebCore, CoreMedia, CMTimeRangeMake, CMTimeRange, (CMTime start, CMTime duration), (start, duration))115 115 SOFT_LINK_FUNCTION_FOR_SOURCE(WebCore, CoreMedia, CMTimeSubtract, CMTime, (CMTime minuend, CMTime subtrahend), (minuend, subtrahend)) 116 116 -
trunk/Source/WebCore/platform/cf/CoreMediaSoftLink.h
r189913 r197204 56 56 SOFT_LINK_FUNCTION_FOR_HEADER(WebCore, CoreMedia, CMTimeRangeGetEnd, CMTime, (CMTimeRange range), (range)) 57 57 #define CMTimeRangeGetEnd softLink_CoreMedia_CMTimeRangeGetEnd 58 SOFT_LINK_FUNCTION_FOR_HEADER(WebCore, CoreMedia, CMTimeRangeMake, CMTimeRange, (CMTime start, CMTime duration), (start, duration)) 59 #define CMTimeRangeMake softLink_CoreMedia_CMTimeRangeMake 58 60 59 61 SOFT_LINK_CONSTANT_FOR_HEADER(WebCore, CoreMedia, kCMFormatDescriptionExtension_SampleDescriptionExtensionAtoms, CFStringRef) … … 188 190 SOFT_LINK_FUNCTION_FOR_HEADER(WebCore, CoreMedia, CMTimeRangeContainsTime, Boolean, (CMTimeRange range, CMTime time), (range, time)) 189 191 #define CMTimeRangeContainsTime softLink_CoreMedia_CMTimeRangeContainsTime 190 SOFT_LINK_FUNCTION_FOR_HEADER(WebCore, CoreMedia, CMTimeRangeMake, CMTimeRange, (CMTime start, CMTime duration), (start, duration))191 #define CMTimeRangeMake softLink_CoreMedia_CMTimeRangeMake192 192 SOFT_LINK_FUNCTION_FOR_HEADER(WebCore, CoreMedia, CMTimeSubtract, CMTime, (CMTime minuend, CMTime subtrahend), (minuend, subtrahend)) 193 193 #define CMTimeSubtract softLink_CoreMedia_CMTimeSubtract -
trunk/Source/WebCore/platform/mac/WebVideoFullscreenInterfaceMac.h
r196964 r197204 36 36 37 37 OBJC_CLASS NSWindow; 38 OBJC_CLASS WebPlaybackControlsManager; 38 39 39 40 #if USE(APPLE_INTERNAL_SDK) … … 62 63 63 64 WEBCORE_EXPORT void resetMediaState() override { } 64 WEBCORE_EXPORT void setDuration(double) override { }65 WEBCORE_EXPORT void setCurrentTime(double /*currentTime*/, double /*anchorTime*/) override { }65 WEBCORE_EXPORT void setDuration(double) override; 66 WEBCORE_EXPORT void setCurrentTime(double /*currentTime*/, double /*anchorTime*/) override; 66 67 WEBCORE_EXPORT void setBufferedTime(double) override { } 67 WEBCORE_EXPORT void setRate(bool /*isPlaying*/, float /*playbackRate*/) override { }68 WEBCORE_EXPORT void setRate(bool /*isPlaying*/, float /*playbackRate*/) override; 68 69 WEBCORE_EXPORT void setVideoDimensions(bool /*hasVideo*/, float /*width*/, float /*height*/) override { } 69 WEBCORE_EXPORT void setSeekableRanges(const TimeRanges&) override { }70 WEBCORE_EXPORT void setSeekableRanges(const TimeRanges&) override; 70 71 WEBCORE_EXPORT void setCanPlayFastReverse(bool) override { } 71 72 WEBCORE_EXPORT void setAudioMediaSelectionOptions(const Vector<WTF::String>& /*options*/, uint64_t /*selectedIndex*/) override { } … … 81 82 WEBCORE_EXPORT void requestHideAndExitFullscreen() { } 82 83 WEBCORE_EXPORT void preparedToReturnToInline(bool visible, const IntRect& inlineRect, NSWindow *parentWindow); 84 WEBCORE_EXPORT void ensureControlsManager(); 83 85 84 86 HTMLMediaElementEnums::VideoFullscreenMode mode() const { return m_mode; } … … 91 93 void applicationDidBecomeActive() { } 92 94 95 WEBCORE_EXPORT WebPlaybackControlsManager *playBackControlsManager(); 96 93 97 private: 94 98 WebVideoFullscreenModel* m_videoFullscreenModel { nullptr }; … … 99 103 RetainPtr<WebVideoFullscreenInterfaceMacObjC> m_webVideoFullscreenInterfaceObjC; 100 104 #endif 105 RetainPtr<WebPlaybackControlsManager> m_playbackControlsManager; 101 106 }; 102 107 -
trunk/Source/WebCore/platform/mac/WebVideoFullscreenInterfaceMac.mm
r196964 r197204 29 29 #if PLATFORM(MAC) && ENABLE(VIDEO_PRESENTATION_MODE) 30 30 31 #import "AVKitSPI.h" 32 #import "CoreMediaSoftLink.h" 31 33 #import "IntRect.h" 34 #import "MediaTimeAVFoundation.h" 35 #import "TimeRanges.h" 32 36 #import "WebVideoFullscreenChangeObserver.h" 33 37 #import "WebVideoFullscreenModel.h" 38 #import <AVFoundation/AVTime.h> 39 40 #import "SoftLinking.h" 41 42 SOFT_LINK_FRAMEWORK(AVKit) 43 SOFT_LINK_CLASS(AVKit, AVValueTiming) 34 44 35 45 #if USE(APPLE_INTERNAL_SDK) 36 46 #include <WebKitAdditions/WebVideoFullscreenInterfaceMacAdditions.mm> 37 47 #endif 48 49 using namespace WebCore; 50 51 @interface WebPlaybackControlsManager : NSObject { 52 @private 53 WebCore::WebVideoFullscreenInterfaceMac* _webVideoFullscreenInterfaceMac; 54 } 55 56 @property (readwrite) NSTimeInterval contentDuration; 57 @property (nonatomic, retain, readwrite) AVValueTiming *timing; 58 @property NSTimeInterval seekToTime; 59 @property (nonatomic, retain, readwrite) NSArray *seekableTimeRanges; 60 @property (readwrite) BOOL hasEnabledAudio; 61 @property (readwrite) BOOL hasEnabledVideo; 62 63 @property (nonatomic) float rate; 64 65 - (instancetype)initWithWebVideoFullscreenInterfaceMac:(WebCore::WebVideoFullscreenInterfaceMac*)webVideoFullscreenInterfaceMac; 66 67 @end 68 69 #if USE(APPLE_INTERNAL_SDK) 70 #import <WebKitAdditions/WebPlaybackControlsControllerAdditions.mm> 71 #endif 72 73 @implementation WebPlaybackControlsManager 74 75 - (instancetype)initWithWebVideoFullscreenInterfaceMac:(WebCore::WebVideoFullscreenInterfaceMac*)webVideoFullscreenInterfaceMac 76 { 77 if (!(self = [super init])) 78 return nil; 79 80 _webVideoFullscreenInterfaceMac = webVideoFullscreenInterfaceMac; 81 82 return self; 83 } 84 85 - (BOOL)isSeeking 86 { 87 return NO; 88 } 89 90 - (void)seekToTime:(NSTimeInterval)time toleranceBefore:(NSTimeInterval)toleranceBefore toleranceAfter:(NSTimeInterval)toleranceAfter 91 { 92 UNUSED_PARAM(toleranceBefore); 93 UNUSED_PARAM(toleranceAfter); 94 _webVideoFullscreenInterfaceMac->webVideoFullscreenModel()->seekToTime(time); 95 } 96 97 - (NSArray *)audioMediaSelectionOptions 98 { 99 return @[]; 100 } 101 102 - (AVMediaSelectionOption *)currentAudioMediaSelectionOption 103 { 104 return nil; 105 } 106 107 - (void)setCurrentAudioMediaSelectionOption:(AVMediaSelectionOption *)audioMediaSelectionOption 108 { 109 UNUSED_PARAM(audioMediaSelectionOption); 110 } 111 112 - (NSArray *)legibleMediaSelectionOptions 113 { 114 return @[]; 115 } 116 117 - (AVMediaSelectionOption *)currentLegibleMediaSelectionOption 118 { 119 return nil; 120 } 121 122 - (void)setCurrentLegibleMediaSelectionOption:(AVMediaSelectionOption *)legibleMediaSelectionOption 123 { 124 UNUSED_PARAM(legibleMediaSelectionOption); 125 } 126 127 - (void)cancelThumbnailAndAudioAmplitudeSampleGeneration 128 { 129 } 130 131 #if USE(APPLE_INTERNAL_SDK) 132 #import <WebKitAdditions/WebPlaybackControlsControllerThumbnailAdditions.mm> 133 #endif 134 135 @end 38 136 39 137 namespace WebCore { … … 75 173 } 76 174 175 void WebVideoFullscreenInterfaceMac::setDuration(double duration) 176 { 177 WebPlaybackControlsManager* controlsManager = playBackControlsManager(); 178 179 controlsManager.contentDuration = duration; 180 181 // FIXME: We take this as an indication that playback is ready, but that is not necessarily true. 182 controlsManager.hasEnabledAudio = YES; 183 controlsManager.hasEnabledVideo = YES; 184 } 185 186 void WebVideoFullscreenInterfaceMac::setCurrentTime(double currentTime, double anchorTime) 187 { 188 WebPlaybackControlsManager* controlsManager = playBackControlsManager(); 189 190 NSTimeInterval anchorTimeStamp = ![controlsManager rate] ? NAN : anchorTime; 191 AVValueTiming *timing = [getAVValueTimingClass() valueTimingWithAnchorValue:currentTime 192 anchorTimeStamp:anchorTimeStamp rate:0]; 193 194 [controlsManager setTiming:timing]; 195 } 196 197 void WebVideoFullscreenInterfaceMac::setRate(bool isPlaying, float playbackRate) 198 { 199 WebPlaybackControlsManager* controlsManager = playBackControlsManager(); 200 201 [controlsManager setRate:isPlaying ? playbackRate : 0.]; 202 } 203 204 void WebVideoFullscreenInterfaceMac::setSeekableRanges(const TimeRanges& timeRanges) 205 { 206 WebPlaybackControlsManager* controlsManager = playBackControlsManager(); 207 208 RetainPtr<NSMutableArray> seekableRanges = adoptNS([[NSMutableArray alloc] init]); 209 210 for (unsigned i = 0; i < timeRanges.length(); i++) { 211 const PlatformTimeRanges& ranges = timeRanges.ranges(); 212 CMTimeRange range = CMTimeRangeMake(toCMTime(ranges.start(i)), toCMTime(ranges.end(i))); 213 [seekableRanges addObject:[NSValue valueWithCMTimeRange:range]]; 214 } 215 216 [controlsManager setSeekableTimeRanges:seekableRanges.get()]; 217 } 218 219 void WebVideoFullscreenInterfaceMac::ensureControlsManager() 220 { 221 playBackControlsManager(); 222 } 223 224 WebPlaybackControlsManager *WebVideoFullscreenInterfaceMac::playBackControlsManager() 225 { 226 #if __MAC_OS_X_VERSION_MIN_REQUIRED >= 101200 227 if (!m_playbackControlsManager) 228 m_playbackControlsManager = adoptNS([[WebPlaybackControlsManager alloc] initWithWebVideoFullscreenInterfaceMac:this]); 229 return m_playbackControlsManager.get(); 230 #else 231 return nil; 232 #endif 233 } 234 77 235 #if !USE(APPLE_INTERNAL_SDK) 78 236 void WebVideoFullscreenInterfaceMac::setupFullscreen(NSView&, const IntRect&, NSWindow *, HTMLMediaElementEnums::VideoFullscreenMode, bool) -
trunk/Source/WebCore/platform/spi/cocoa/AVKitSPI.h
r193340 r197204 26 26 #import "SoftLinking.h" 27 27 #import <objc/runtime.h> 28 29 #if USE(APPLE_INTERNAL_SDK) 30 31 #import <AVKit/AVValueTiming.h> 32 33 #else 34 35 @interface AVValueTiming : NSObject <NSCoding, NSCopying, NSMutableCopying> 36 @end 37 38 @interface AVValueTiming () 39 + (AVValueTiming *)valueTimingWithAnchorValue:(double)anchorValue anchorTimeStamp:(NSTimeInterval)timeStamp rate:(double)rate; 40 @property (NS_NONATOMIC_IOSONLY, readonly) double currentValue; 41 @end 42 43 #endif // USE(APPLE_INTERNAL_SDK) 28 44 29 45 #if PLATFORM(IOS) … … 102 118 103 119 #endif // USE(APPLE_INTERNAL_SDK) 104 105 @interface AVValueTiming : NSObject <NSCoding, NSCopying, NSMutableCopying>106 @end107 108 @interface AVValueTiming ()109 + (AVValueTiming *)valueTimingWithAnchorValue:(double)anchorValue anchorTimeStamp:(NSTimeInterval)timeStamp rate:(double)rate;110 @property (NS_NONATOMIC_IOSONLY, readonly) double currentValue;111 @end112 113 120 #endif // PLATFORM(IOS) 114 121 -
trunk/Source/WebKit2/ChangeLog
r197203 r197204 1 2016-02-26 Beth Dakin <bdakin@apple.com> 2 3 Add support for playbackControlsManager 4 https://bugs.webkit.org/show_bug.cgi?id=154742 5 -and corresponding- 6 rdar://problem/23833753 7 8 Reviewed by Jer Noble. 9 10 WebVideoFullscreenManagerProxy ensures the model and interface for the 11 UIProcess side of the playbackControlsManager. It also caches the 12 m_controlsManagerContextId so that it can return the 13 controlsManagerInterface. 14 * UIProcess/Cocoa/WebVideoFullscreenManagerProxy.h: 15 * UIProcess/Cocoa/WebVideoFullscreenManagerProxy.messages.in: 16 * UIProcess/Cocoa/WebVideoFullscreenManagerProxy.mm: 17 (WebKit::WebVideoFullscreenManagerProxy::setUpVideoControlsManagerWithID): 18 (WebKit::WebVideoFullscreenManagerProxy::controlsManagerInterface): 19 20 Pipe isPlayingMediaDidChange() to WebViewImpl, and use that information to 21 update WebViewImplAdditions. 22 * UIProcess/Cocoa/WebViewImpl.h: 23 * UIProcess/Cocoa/WebViewImpl.mm: 24 (WebKit::WebViewImpl::isPlayingMediaDidChange): 25 * UIProcess/PageClient.h: 26 * UIProcess/WebPageProxy.cpp: 27 (WebKit::WebPageProxy::isPlayingMediaDidChange): 28 (WebKit::WebPageProxy::isPlayingVideoWithAudio): 29 * UIProcess/WebPageProxy.h: 30 (WebKit::WebPageProxy::isPlayingAudio): 31 * UIProcess/mac/PageClientImpl.h: 32 * UIProcess/mac/PageClientImpl.mm: 33 (WebKit::PageClientImpl::isPlayingMediaDidChange): 34 35 Pipe setUpVideoControlsManager to the WebVideoFullscreenManager. 36 * WebProcess/WebCoreSupport/WebChromeClient.cpp: 37 (WebKit::WebChromeClient::setUpVideoControlsManager): 38 * WebProcess/WebCoreSupport/WebChromeClient.h: 39 40 Ensure the model an interface for the playbackControlsManager on the 41 WebProcess side and pass the message to the UIProcess to do the same. 42 * WebProcess/cocoa/WebVideoFullscreenManager.h: 43 * WebProcess/cocoa/WebVideoFullscreenManager.mm: 44 (WebKit::WebVideoFullscreenManager::setUpVideoControlsManager): 45 1 46 2016-02-26 Anders Carlsson <andersca@apple.com> 2 47 -
trunk/Source/WebKit2/UIProcess/Cocoa/WebVideoFullscreenManagerProxy.h
r195755 r197204 120 120 bool isVisible() const; 121 121 122 PlatformWebVideoFullscreenInterface& controlsManagerInterface(); 123 122 124 private: 123 125 friend class WebVideoFullscreenModelContext; … … 134 136 // Messages from WebVideoFullscreenManager 135 137 void setupFullscreenWithID(uint64_t contextId, uint32_t videoLayerID, const WebCore::IntRect& initialRect, float hostingScaleFactor, WebCore::HTMLMediaElementEnums::VideoFullscreenMode, bool allowsPictureInPicture); 138 void setUpVideoControlsManagerWithID(uint64_t contextId); 136 139 void resetMediaState(uint64_t contextId); 137 140 void setCurrentTime(uint64_t contextId, double currentTime, double hostTime); … … 176 179 WebPageProxy* m_page; 177 180 HashMap<uint64_t, ModelInterfaceTuple> m_contextMap; 181 uint64_t m_controlsManagerContextId { 0 }; 178 182 179 183 }; -
trunk/Source/WebKit2/UIProcess/Cocoa/WebVideoFullscreenManagerProxy.messages.in
r195755 r197204 40 40 CleanupFullscreen(uint64_t contextId) 41 41 PreparedToReturnToInline(uint64_t contextId, bool visible, WebCore::IntRect inlineRect) 42 SetUpVideoControlsManagerWithID(uint64_t contextId) 42 43 } 43 44 #endif -
trunk/Source/WebKit2/UIProcess/Cocoa/WebVideoFullscreenManagerProxy.mm
r196964 r197204 375 375 } 376 376 377 void WebVideoFullscreenManagerProxy::setUpVideoControlsManagerWithID(uint64_t contextId) 378 { 379 RefPtr<WebVideoFullscreenModelContext> model; 380 RefPtr<PlatformWebVideoFullscreenInterface> interface; 381 382 std::tie(model, interface) = ensureModelAndInterface(contextId); 383 m_controlsManagerContextId = contextId; 384 interface->ensureControlsManager(); 385 } 386 377 387 void WebVideoFullscreenManagerProxy::resetMediaState(uint64_t contextId) 378 388 { … … 616 626 } 617 627 628 PlatformWebVideoFullscreenInterface& WebVideoFullscreenManagerProxy::controlsManagerInterface() 629 { 630 return ensureInterface(m_controlsManagerContextId); 631 } 632 618 633 void WebVideoFullscreenManagerProxy::fullscreenMayReturnToInline(uint64_t contextId) 619 634 { -
trunk/Source/WebKit2/UIProcess/Cocoa/WebViewImpl.h
r196452 r197204 325 325 void didChangeContentSize(CGSize); 326 326 void didHandleAcceptedCandidate(); 327 void isPlayingMediaDidChange(); 327 328 328 329 void setIgnoresNonWheelEvents(bool); -
trunk/Source/WebKit2/UIProcess/Cocoa/WebViewImpl.mm
r196456 r197204 2372 2372 } 2373 2373 2374 void WebViewImpl::isPlayingMediaDidChange() 2375 { 2376 #if __MAC_OS_X_VERSION_MIN_REQUIRED >= 101200 2377 updateWebViewImplAdditions(); 2378 #endif 2379 } 2380 2374 2381 void WebViewImpl::setIgnoresNonWheelEvents(bool ignoresNonWheelEvents) 2375 2382 { -
trunk/Source/WebKit2/UIProcess/PageClient.h
r196964 r197204 351 351 352 352 virtual void didHandleAcceptedCandidate() = 0; 353 354 virtual void isPlayingMediaDidChange() = 0; 353 355 #endif 354 356 -
trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp
r197161 r197204 5986 5986 return; 5987 5987 5988 #if PLATFORM(MAC) 5989 m_pageClient.isPlayingMediaDidChange(); 5990 #endif 5988 5991 m_uiClient->isPlayingAudioDidChange(*this); 5992 } 5993 5994 bool WebPageProxy::isPlayingVideoWithAudio() const 5995 { 5996 return m_mediaState & MediaProducer::IsPlayingAudio && m_mediaState & MediaProducer::IsPlayingVideo; 5989 5997 } 5990 5998 -
trunk/Source/WebKit2/UIProcess/WebPageProxy.h
r197161 r197204 1012 1012 void isPlayingMediaDidChange(WebCore::MediaProducer::MediaStateFlags, uint64_t); 1013 1013 1014 bool isPlayingVideoWithAudio() const; 1015 1014 1016 #if ENABLE(MEDIA_SESSION) 1015 1017 void hasMediaSessionWithActiveMediaElementsDidChange(bool); -
trunk/Source/WebKit2/UIProcess/mac/PageClientImpl.h
r196964 r197204 215 215 virtual void didHandleAcceptedCandidate() override; 216 216 217 void isPlayingMediaDidChange() override; 218 217 219 virtual void showPlatformContextMenu(NSMenu *, WebCore::IntPoint) override; 218 220 -
trunk/Source/WebKit2/UIProcess/mac/PageClientImpl.mm
r196964 r197204 795 795 } 796 796 797 void PageClientImpl::isPlayingMediaDidChange() 798 { 799 m_impl->isPlayingMediaDidChange(); 800 } 801 797 802 void PageClientImpl::showPlatformContextMenu(NSMenu *menu, IntPoint location) 798 803 { -
trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp
r196964 r197204 856 856 } 857 857 858 void WebChromeClient::setUpVideoControlsManager(WebCore::HTMLVideoElement& videoElement) 859 { 860 m_page->videoFullscreenManager()->setUpVideoControlsManager(videoElement); 861 } 862 858 863 void WebChromeClient::enterVideoFullscreenForVideoElement(WebCore::HTMLVideoElement& videoElement, WebCore::HTMLMediaElementEnums::VideoFullscreenMode mode) 859 864 { -
trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.h
r195755 r197204 245 245 #if PLATFORM(IOS) || (PLATFORM(MAC) && ENABLE(VIDEO_PRESENTATION_MODE)) 246 246 virtual bool supportsVideoFullscreen(WebCore::HTMLMediaElementEnums::VideoFullscreenMode) override; 247 virtual void setUpVideoControlsManager(WebCore::HTMLVideoElement&) override; 247 248 virtual void enterVideoFullscreenForVideoElement(WebCore::HTMLVideoElement&, WebCore::HTMLMediaElementEnums::VideoFullscreenMode) override; 248 249 virtual void exitVideoFullscreenForVideoElement(WebCore::HTMLVideoElement&) override; -
trunk/Source/WebKit2/WebProcess/cocoa/WebVideoFullscreenManager.h
r196964 r197204 117 117 void enterVideoFullscreenForVideoElement(WebCore::HTMLVideoElement&, WebCore::HTMLMediaElementEnums::VideoFullscreenMode); 118 118 void exitVideoFullscreenForVideoElement(WebCore::HTMLVideoElement&); 119 void setUpVideoControlsManager(WebCore::HTMLVideoElement&); 119 120 120 121 protected: -
trunk/Source/WebKit2/WebProcess/cocoa/WebVideoFullscreenManager.mm
r196964 r197204 280 280 } 281 281 282 void WebVideoFullscreenManager::setUpVideoControlsManager(WebCore::HTMLVideoElement& videoElement) 283 { 284 auto addResult = m_videoElements.ensure(&videoElement, [&] { return nextContextId(); }); 285 auto contextId = addResult.iterator->value; 286 287 RefPtr<WebVideoFullscreenModelVideoElement> model; 288 RefPtr<WebVideoFullscreenInterfaceContext> interface; 289 std::tie(model, interface) = ensureModelAndInterface(contextId); 290 model->setVideoElement(&videoElement); 291 292 m_page->send(Messages::WebVideoFullscreenManagerProxy::SetUpVideoControlsManagerWithID(contextId), m_page->pageID()); 293 } 294 282 295 #pragma mark Interface to WebVideoFullscreenInterfaceContext: 283 296
Note: See TracChangeset
for help on using the changeset viewer.