Title: [176841] trunk/Source
Revision
176841
Author
[email protected]
Date
2014-12-05 05:25:28 -0800 (Fri, 05 Dec 2014)

Log Message

[iOS] allow host application to opt-out of alternate fullscreen pt. 2
https://bugs.webkit.org/show_bug.cgi?id=139227

Source/WebCore:

Reviewed by Jer Noble and Anders Carlsson

* WebCore.exp.in: Export HTMLMediaSession::allowsAlternateFullscreen, change the signature of 
    WebVideoFullscreenInterfaceAVKit::setupFullscreen.

* platform/ios/WebVideoFullscreenControllerAVKit.mm:
(-[WebVideoFullscreenController enterFullscreen:mode:]): Update for
    WebVideoFullscreenInterfaceAVKit::setupFullscreen change.

* platform/ios/WebVideoFullscreenInterfaceAVKit.h: Add argument to setupFullscreen.
* platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
(WebVideoFullscreenInterfaceAVKit::setupFullscreen): Ditto.

Source/WebKit2:

Reviewed by Jer Noble and Anders Carlsson.

* UIProcess/ios/WebVideoFullscreenManagerProxy.h: Add bool param to setupFullscreenWithID.
* UIProcess/ios/WebVideoFullscreenManagerProxy.messages.in: Ditto.
* UIProcess/ios/WebVideoFullscreenManagerProxy.mm:
(WebKit::WebVideoFullscreenManagerProxy::setupFullscreenWithID): Ditto.

* WebProcess/ios/WebVideoFullscreenManager.mm:
(WebKit::WebVideoFullscreenManager::enterVideoFullscreenForVideoElement): Pass new parameter
    to SetupFullscreenWithID.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (176840 => 176841)


--- trunk/Source/WebCore/ChangeLog	2014-12-05 10:29:32 UTC (rev 176840)
+++ trunk/Source/WebCore/ChangeLog	2014-12-05 13:25:28 UTC (rev 176841)
@@ -1,3 +1,21 @@
+2014-12-05  Eric Carlson  <[email protected]>
+
+        [iOS] allow host application to opt-out of alternate fullscreen pt. 2
+        https://bugs.webkit.org/show_bug.cgi?id=139227
+
+        Reviewed by Jer Noble and Anders Carlsson
+
+        * WebCore.exp.in: Export HTMLMediaSession::allowsAlternateFullscreen, change the signature of 
+            WebVideoFullscreenInterfaceAVKit::setupFullscreen.
+
+        * platform/ios/WebVideoFullscreenControllerAVKit.mm:
+        (-[WebVideoFullscreenController enterFullscreen:mode:]): Update for
+            WebVideoFullscreenInterfaceAVKit::setupFullscreen change.
+
+        * platform/ios/WebVideoFullscreenInterfaceAVKit.h: Add argument to setupFullscreen.
+        * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
+        (WebVideoFullscreenInterfaceAVKit::setupFullscreen): Ditto.
+
 2014-12-05  Shivakumar JM  <[email protected]>
 
         Fix build warning in WebCore/platform/graphics module

Modified: trunk/Source/WebCore/WebCore.exp.in (176840 => 176841)


--- trunk/Source/WebCore/WebCore.exp.in	2014-12-05 10:29:32 UTC (rev 176840)
+++ trunk/Source/WebCore/WebCore.exp.in	2014-12-05 13:25:28 UTC (rev 176841)
@@ -3478,6 +3478,7 @@
 __ZN7WebCore35WebVideoFullscreenModelVideoElement8fastSeekEd
 __ZN7WebCore35WebVideoFullscreenModelVideoElementC2Ev
 __ZN7WebCore35WebVideoFullscreenModelVideoElementD2Ev
+__ZNK7WebCore16HTMLMediaSession25allowsAlternateFullscreenERKNS_16HTMLMediaElementE
 __ZNK7WebCore16HTMLVideoElement10videoWidthEv
 __ZNK7WebCore16HTMLVideoElement11videoHeightEv
 __ZThn?_N7WebCore35WebVideoFullscreenModelVideoElement11handleEventEPNS_22ScriptExecutionContextEPNS_5EventE
@@ -3489,7 +3490,7 @@
 __ZN7WebCore32WebVideoFullscreenInterfaceAVKit14exitFullscreenENS_7IntRectE
 __ZN7WebCore32WebVideoFullscreenInterfaceAVKit14setCurrentTimeEdd
 __ZN7WebCore32WebVideoFullscreenInterfaceAVKit15enterFullscreenEv
-__ZN7WebCore32WebVideoFullscreenInterfaceAVKit15setupFullscreenER7CALayerNS_7IntRectEP6UIViewNS_16HTMLMediaElement19VideoFullscreenModeE
+__ZN7WebCore32WebVideoFullscreenInterfaceAVKit15setupFullscreenER7CALayerNS_7IntRectEP6UIViewNS_16HTMLMediaElement19VideoFullscreenModeEb
 __ZN7WebCore32WebVideoFullscreenInterfaceAVKit17cleanupFullscreenEv
 __ZN7WebCore32WebVideoFullscreenInterfaceAVKit17setSeekableRangesERKNS_10TimeRangesE
 __ZN7WebCore32WebVideoFullscreenInterfaceAVKit18setVideoDimensionsEbff

Modified: trunk/Source/WebCore/platform/ios/WebVideoFullscreenControllerAVKit.mm (176840 => 176841)


--- trunk/Source/WebCore/platform/ios/WebVideoFullscreenControllerAVKit.mm	2014-12-05 10:29:32 UTC (rev 176840)
+++ trunk/Source/WebCore/platform/ios/WebVideoFullscreenControllerAVKit.mm	2014-12-05 13:25:28 UTC (rev 176841)
@@ -125,7 +125,7 @@
     _interface->setWebVideoFullscreenModel(_model.get());
     _model->setVideoElement(_videoElement.get());
     _videoFullscreenLayer = [CALayer layer];
-    _interface->setupFullscreen(*_videoFullscreenLayer.get(), _videoElement->clientRect(), view, mode);
+    _interface->setupFullscreen(*_videoFullscreenLayer.get(), _videoElement->clientRect(), view, mode, _videoElement->mediaSession().allowsAlternateFullscreen(*_videoElement.get()));
 }
 
 - (void)exitFullscreen

Modified: trunk/Source/WebCore/platform/ios/WebVideoFullscreenInterfaceAVKit.h (176840 => 176841)


--- trunk/Source/WebCore/platform/ios/WebVideoFullscreenInterfaceAVKit.h	2014-12-05 10:29:32 UTC (rev 176840)
+++ trunk/Source/WebCore/platform/ios/WebVideoFullscreenInterfaceAVKit.h	2014-12-05 13:25:28 UTC (rev 176841)
@@ -81,7 +81,7 @@
     WEBCORE_EXPORT virtual void setLegibleMediaSelectionOptions(const Vector<WTF::String>& options, uint64_t selectedIndex) override;
     WEBCORE_EXPORT virtual void setExternalPlayback(bool enabled, ExternalPlaybackTargetType, WTF::String localizedDeviceName) override;
     
-    WEBCORE_EXPORT virtual void setupFullscreen(PlatformLayer&, IntRect initialRect, UIView *, HTMLMediaElement::VideoFullscreenMode);
+    WEBCORE_EXPORT virtual void setupFullscreen(PlatformLayer&, IntRect initialRect, UIView *, HTMLMediaElement::VideoFullscreenMode, bool allowOptimizedFullscreen);
     WEBCORE_EXPORT virtual void enterFullscreen();
     WEBCORE_EXPORT virtual void exitFullscreen(IntRect finalRect);
     WEBCORE_EXPORT virtual void cleanupFullscreen();

Modified: trunk/Source/WebCore/platform/ios/WebVideoFullscreenInterfaceAVKit.mm (176840 => 176841)


--- trunk/Source/WebCore/platform/ios/WebVideoFullscreenInterfaceAVKit.mm	2014-12-05 10:29:32 UTC (rev 176840)
+++ trunk/Source/WebCore/platform/ios/WebVideoFullscreenInterfaceAVKit.mm	2014-12-05 13:25:28 UTC (rev 176841)
@@ -784,7 +784,7 @@
     });
 }
 
-void WebVideoFullscreenInterfaceAVKit::setupFullscreen(PlatformLayer& videoLayer, WebCore::IntRect initialRect, UIView* parentView, HTMLMediaElement::VideoFullscreenMode mode)
+void WebVideoFullscreenInterfaceAVKit::setupFullscreen(PlatformLayer& videoLayer, WebCore::IntRect initialRect, UIView* parentView, HTMLMediaElement::VideoFullscreenMode mode, bool allowOptimizedFullscreen)
 {
     __block RefPtr<WebVideoFullscreenInterfaceAVKit> protect(this);
     
@@ -823,6 +823,8 @@
         [m_playerViewController setShowsPlaybackControls:NO];
         [m_playerViewController setPlayerController:(AVPlayerController *)playerController()];
         [m_playerViewController setDelegate:playerController()];
+        [m_playerViewController setAllowsOptimizedFullscreen:allowOptimizedFullscreen];
+
         [m_videoLayerContainer setPlayerViewController:m_playerViewController.get()];
 
         if (m_viewController) {

Modified: trunk/Source/WebKit2/ChangeLog (176840 => 176841)


--- trunk/Source/WebKit2/ChangeLog	2014-12-05 10:29:32 UTC (rev 176840)
+++ trunk/Source/WebKit2/ChangeLog	2014-12-05 13:25:28 UTC (rev 176841)
@@ -1,3 +1,19 @@
+2014-12-05  Eric Carlson  <[email protected]>
+
+        [iOS] allow host application to opt-out of alternate fullscreen pt. 2
+        https://bugs.webkit.org/show_bug.cgi?id=139227
+
+        Reviewed by Jer Noble and Anders Carlsson.
+
+        * UIProcess/ios/WebVideoFullscreenManagerProxy.h: Add bool param to setupFullscreenWithID.
+        * UIProcess/ios/WebVideoFullscreenManagerProxy.messages.in: Ditto.
+        * UIProcess/ios/WebVideoFullscreenManagerProxy.mm:
+        (WebKit::WebVideoFullscreenManagerProxy::setupFullscreenWithID): Ditto.
+
+        * WebProcess/ios/WebVideoFullscreenManager.mm:
+        (WebKit::WebVideoFullscreenManager::enterVideoFullscreenForVideoElement): Pass new parameter
+            to SetupFullscreenWithID.
+
 2014-12-04  Anders Carlsson  <[email protected]>
 
         Add missing includes in preparation for making toAPI require that it's passed an API::Object

Modified: trunk/Source/WebKit2/UIProcess/ios/WebVideoFullscreenManagerProxy.h (176840 => 176841)


--- trunk/Source/WebKit2/UIProcess/ios/WebVideoFullscreenManagerProxy.h	2014-12-05 10:29:32 UTC (rev 176840)
+++ trunk/Source/WebKit2/UIProcess/ios/WebVideoFullscreenManagerProxy.h	2014-12-05 13:25:28 UTC (rev 176841)
@@ -55,7 +55,7 @@
     virtual void didReceiveMessage(IPC::Connection*, IPC::MessageDecoder&) override;
 
     // Translate to FullscreenInterface
-    void setupFullscreenWithID(uint32_t, WebCore::IntRect initialRect, float hostingDeviceScaleFactor, uint32_t videoFullscreenMode);
+    void setupFullscreenWithID(uint32_t, WebCore::IntRect initialRect, float hostingDeviceScaleFactor, uint32_t videoFullscreenMode, bool allowOptimizedFullscreen);
     void setSeekableRangesVector(Vector<std::pair<double, double>>&);
     void setExternalPlaybackProperties(bool enabled, uint32_t targetType, String localizedDeviceName);
     

Modified: trunk/Source/WebKit2/UIProcess/ios/WebVideoFullscreenManagerProxy.messages.in (176840 => 176841)


--- trunk/Source/WebKit2/UIProcess/ios/WebVideoFullscreenManagerProxy.messages.in	2014-12-05 10:29:32 UTC (rev 176840)
+++ trunk/Source/WebKit2/UIProcess/ios/WebVideoFullscreenManagerProxy.messages.in	2014-12-05 13:25:28 UTC (rev 176841)
@@ -31,7 +31,7 @@
     SetExternalPlaybackProperties(bool enabled, uint32_t targetType, String localizedDeviceName);
     SetDuration(double duration)
     SetRate(bool isPlaying, double rate)
-    SetupFullscreenWithID(uint32_t videoLayerID, WebCore::IntRect initialRect, float hostingScaleFactor, uint32_t videoFullscreenMode)
+    SetupFullscreenWithID(uint32_t videoLayerID, WebCore::IntRect initialRect, float hostingScaleFactor, uint32_t videoFullscreenMode, bool allowOptimizedFullscreen)
     EnterFullscreen()
     ExitFullscreen(WebCore::IntRect finalRect)
     CleanupFullscreen()

Modified: trunk/Source/WebKit2/UIProcess/ios/WebVideoFullscreenManagerProxy.mm (176840 => 176841)


--- trunk/Source/WebKit2/UIProcess/ios/WebVideoFullscreenManagerProxy.mm	2014-12-05 10:29:32 UTC (rev 176840)
+++ trunk/Source/WebKit2/UIProcess/ios/WebVideoFullscreenManagerProxy.mm	2014-12-05 13:25:28 UTC (rev 176841)
@@ -84,7 +84,7 @@
     m_layerHost.clear();
 }
 
-void WebVideoFullscreenManagerProxy::setupFullscreenWithID(uint32_t videoLayerID, WebCore::IntRect initialRect, float hostingDeviceScaleFactor, uint32_t videoFullscreenMode)
+void WebVideoFullscreenManagerProxy::setupFullscreenWithID(uint32_t videoLayerID, WebCore::IntRect initialRect, float hostingDeviceScaleFactor, uint32_t videoFullscreenMode, bool allowOptimizedFullscreen)
 {
     ASSERT(videoLayerID);
     m_layerHost = WKMakeRenderLayer(videoLayerID);
@@ -96,7 +96,7 @@
 
     UIView *parentView = downcast<RemoteLayerTreeDrawingAreaProxy>(*m_page->drawingArea()).remoteLayerTreeHost().rootLayer();
     HTMLMediaElement::VideoFullscreenMode mode = static_cast<HTMLMediaElement::VideoFullscreenMode>(videoFullscreenMode);
-    setupFullscreen(*m_layerHost.get(), initialRect, parentView, mode);
+    setupFullscreen(*m_layerHost.get(), initialRect, parentView, mode, allowOptimizedFullscreen);
 }
     
 void WebVideoFullscreenManagerProxy::setSeekableRangesVector(Vector<std::pair<double, double>>& ranges)

Modified: trunk/Source/WebKit2/WebProcess/ios/WebVideoFullscreenManager.mm (176840 => 176841)


--- trunk/Source/WebKit2/WebProcess/ios/WebVideoFullscreenManager.mm	2014-12-05 10:29:32 UTC (rev 176840)
+++ trunk/Source/WebKit2/WebProcess/ios/WebVideoFullscreenManager.mm	2014-12-05 13:25:28 UTC (rev 176841)
@@ -101,8 +101,9 @@
     setVideoElement(videoElement);
 
     m_layerHostingContext = LayerHostingContext::createForExternalHostingProcess();
+    bool allowOptimizedFullscreen = m_videoElement->mediaSession().allowsAlternateFullscreen(*m_videoElement.get());
     
-    m_page->send(Messages::WebVideoFullscreenManagerProxy::SetupFullscreenWithID(m_layerHostingContext->contextID(), clientRectForElement(videoElement), m_page->deviceScaleFactor(), m_fullscreenMode), m_page->pageID());
+    m_page->send(Messages::WebVideoFullscreenManagerProxy::SetupFullscreenWithID(m_layerHostingContext->contextID(), clientRectForElement(videoElement), m_page->deviceScaleFactor(), m_fullscreenMode, allowOptimizedFullscreen), m_page->pageID());
 }
 
 void WebVideoFullscreenManager::exitVideoFullscreen()
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to