Title: [228712] trunk/Source
Revision
228712
Author
eric.carl...@apple.com
Date
2018-02-19 14:29:38 -0800 (Mon, 19 Feb 2018)

Log Message

[Extra zoom mode] Don't allow PiP media playback
https://bugs.webkit.org/show_bug.cgi?id=182930
<rdar://problem/37676259>

Reviewed by Andy Estes.

Source/WebCore:

* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayerLayer): Don't call setPIPModeEnabled:
if it isn't implemented.
(WebCore::MediaPlayerPrivateAVFoundationObjC::setVideoFullscreenMode): Ditto.

Source/WebKit:

* UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
(-[WKWebViewConfiguration init]): Don't enable PiP mode. Require user interaction for
all media types.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (228711 => 228712)


--- trunk/Source/WebCore/ChangeLog	2018-02-19 22:20:13 UTC (rev 228711)
+++ trunk/Source/WebCore/ChangeLog	2018-02-19 22:29:38 UTC (rev 228712)
@@ -1,3 +1,16 @@
+2018-02-19  Eric Carlson  <eric.carl...@apple.com>
+
+        [Extra zoom mode] Don't allow PiP media playback
+        https://bugs.webkit.org/show_bug.cgi?id=182930
+        <rdar://problem/37676259>
+
+        Reviewed by Andy Estes.
+
+        * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
+        (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayerLayer): Don't call setPIPModeEnabled:
+        if it isn't implemented.
+        (WebCore::MediaPlayerPrivateAVFoundationObjC::setVideoFullscreenMode): Ditto.
+
 2018-02-19  Antoine Quint  <grao...@apple.com>
 
         [Web Animations] Decouple parsing JS keyframes and computing blending keyframes

Modified: trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm (228711 => 228712)


--- trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm	2018-02-19 22:20:13 UTC (rev 228711)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm	2018-02-19 22:29:38 UTC (rev 228712)
@@ -708,7 +708,8 @@
     m_videoFullscreenLayerManager->setVideoLayer(m_videoLayer.get(), defaultSize);
 
 #if PLATFORM(IOS)
-    [m_videoLayer setPIPModeEnabled:(player()->fullscreenMode() & MediaPlayer::VideoFullscreenModePictureInPicture)];
+    if ([m_videoLayer respondsToSelector:@selector(setPIPModeEnabled:)])
+        [m_videoLayer setPIPModeEnabled:(player()->fullscreenMode() & MediaPlayer::VideoFullscreenModePictureInPicture)];
 #endif
 #else
     [m_videoLayer setFrame:CGRectMake(0, 0, defaultSize.width(), defaultSize.height())];
@@ -1228,7 +1229,8 @@
 void MediaPlayerPrivateAVFoundationObjC::setVideoFullscreenMode(MediaPlayer::VideoFullscreenMode mode)
 {
 #if PLATFORM(IOS)
-    [m_videoLayer setPIPModeEnabled:(mode & MediaPlayer::VideoFullscreenModePictureInPicture)];
+    if ([m_videoLayer respondsToSelector:@selector(setPIPModeEnabled:)])
+        [m_videoLayer setPIPModeEnabled:(mode & MediaPlayer::VideoFullscreenModePictureInPicture)];
     updateDisableExternalPlayback();
 #else
     UNUSED_PARAM(mode);

Modified: trunk/Source/WebKit/ChangeLog (228711 => 228712)


--- trunk/Source/WebKit/ChangeLog	2018-02-19 22:20:13 UTC (rev 228711)
+++ trunk/Source/WebKit/ChangeLog	2018-02-19 22:29:38 UTC (rev 228712)
@@ -1,3 +1,15 @@
+2018-02-19  Eric Carlson  <eric.carl...@apple.com>
+
+        [Extra zoom mode] Don't allow PiP media playback
+        https://bugs.webkit.org/show_bug.cgi?id=182930
+        <rdar://problem/37676259>
+
+        Reviewed by Andy Estes.
+
+        * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
+        (-[WKWebViewConfiguration init]): Don't enable PiP mode. Require user interaction for
+        all media types.
+
 2018-02-19  Ryan Haddad  <ryanhad...@apple.com>
 
         Unreviewed, rolling out r228696.

Modified: trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebViewConfiguration.mm (228711 => 228712)


--- trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebViewConfiguration.mm	2018-02-19 22:20:13 UTC (rev 228711)
+++ trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebViewConfiguration.mm	2018-02-19 22:29:38 UTC (rev 228712)
@@ -174,14 +174,18 @@
     WebKit::InitializeWebKit2();
 
 #if PLATFORM(IOS)
+#if !ENABLE(EXTRA_ZOOM_MODE)
     _allowsPictureInPictureMediaPlayback = YES;
+#endif
     _allowsInlineMediaPlayback = WebCore::deviceClass() == MGDeviceClassiPad;
     _inlineMediaPlaybackRequiresPlaysInlineAttribute = !_allowsInlineMediaPlayback;
     _allowsInlineMediaPlaybackAfterFullscreen = !_allowsInlineMediaPlayback;
     _mediaDataLoadsAutomatically = NO;
+#if !ENABLE(EXTRA_ZOOM_MODE)
     if (WebKit::linkedOnOrAfter(WebKit::SDKVersion::FirstWithMediaTypesRequiringUserActionForPlayback))
         _mediaTypesRequiringUserActionForPlayback = WKAudiovisualMediaTypeAudio;
     else
+#endif
         _mediaTypesRequiringUserActionForPlayback = WKAudiovisualMediaTypeAll;
     _ignoresViewportScaleLimits = NO;
     _legacyEncryptedMediaAPIEnabled = NO;
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to