[iOS] Fullscreen "stay in page" option breaks video playback
authorjer.noble@apple.com <jer.noble@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 4 Mar 2019 16:44:51 +0000 (16:44 +0000)
committerjer.noble@apple.com <jer.noble@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 4 Mar 2019 16:44:51 +0000 (16:44 +0000)
https://bugs.webkit.org/show_bug.cgi?id=195277
<rdar://problem/48537317>

Reviewed by Eric Carlson.

Source/WebCore:

Add a LOG entry when playback is rejected due to media playback suspension.

* html/MediaElementSession.cpp:
(WebCore::MediaElementSession::playbackPermitted const):

Source/WebKit:

Make sure we resume media playback when the user chooses "stay in page" from the deceptive
website warning dialog.

* UIProcess/ios/fullscreen/WKFullScreenViewController.mm:
(-[WKFullScreenViewController _showPhishingAlert]):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@242355 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/html/MediaElementSession.cpp
Source/WebKit/ChangeLog
Source/WebKit/UIProcess/ios/fullscreen/WKFullScreenViewController.mm

index ceabb76..c9ce316 100644 (file)
@@ -1,3 +1,16 @@
+2019-03-04  Jer Noble  <jer.noble@apple.com>
+
+        [iOS] Fullscreen "stay in page" option breaks video playback
+        https://bugs.webkit.org/show_bug.cgi?id=195277
+        <rdar://problem/48537317>
+
+        Reviewed by Eric Carlson.
+
+        Add a LOG entry when playback is rejected due to media playback suspension.
+
+        * html/MediaElementSession.cpp:
+        (WebCore::MediaElementSession::playbackPermitted const):
+
 2019-03-04  Tim Horton  <timothy_horton@apple.com>
 
         Fix the build.
index 14cf711..2d7f1b7 100644 (file)
@@ -273,8 +273,10 @@ SuccessOr<MediaPlaybackDenialReason> MediaElementSession::playbackPermitted() co
 
     auto& document = m_element.document();
     auto* page = document.page();
-    if (!page || page->mediaPlaybackIsSuspended())
+    if (!page || page->mediaPlaybackIsSuspended()) {
+        ALWAYS_LOG(LOGIDENTIFIER, "Returning FALSE because media playback is suspended");
         return MediaPlaybackDenialReason::PageConsentRequired;
+    }
 
     if (document.isMediaDocument() && !document.ownerElement())
         return { };
index 41f51be..86d72f5 100644 (file)
@@ -1,3 +1,17 @@
+2019-03-04  Jer Noble  <jer.noble@apple.com>
+
+        [iOS] Fullscreen "stay in page" option breaks video playback
+        https://bugs.webkit.org/show_bug.cgi?id=195277
+        <rdar://problem/48537317>
+
+        Reviewed by Eric Carlson.
+
+        Make sure we resume media playback when the user chooses "stay in page" from the deceptive
+        website warning dialog.
+
+        * UIProcess/ios/fullscreen/WKFullScreenViewController.mm:
+        (-[WKFullScreenViewController _showPhishingAlert]):
+
 2019-03-04  Michael Catanzaro  <mcatanzaro@igalia.com>
 
         [WPE] Enable web process sandbox
index 351b61f..990509c 100644 (file)
@@ -570,8 +570,10 @@ private:
     }];
 
     UIAlertAction* stayAction = [UIAlertAction actionWithTitle:WEB_UI_STRING_KEY("Stay in Full Screen", "Stay in Full Screen (Element Full Screen)", "Full Screen Deceptive Website Stay Action") style:UIAlertActionStyleDefault handler:^(UIAlertAction * action) {
-        if (auto* page = [self._webView _page])
+        if (auto* page = [self._webView _page]) {
             page->resumeActiveDOMObjectsAndAnimations();
+            page->resumeAllMediaPlayback();
+        }
         _secheuristic.reset();
     }];