Title: [250441] trunk/Source/WebCore
Revision
250441
Author
[email protected]
Date
2019-09-27 12:48:05 -0700 (Fri, 27 Sep 2019)

Log Message

[iOS] Vimeo fails to AirPlay in desktop mode
https://bugs.webkit.org/show_bug.cgi?id=202322

Reviewed by Eric Carlson.

Add a Quirk which opts Vimeo out of the preload=auto restriction, and allows their
second video element containing a HLS stream to correctly start AirPlaying when the
system route changes.

* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::finishInitialization):
* page/Quirks.cpp:
(WebCore::Quirks::needsPreloadAutoQuirk const):
* page/Quirks.h:

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (250440 => 250441)


--- trunk/Source/WebCore/ChangeLog	2019-09-27 19:30:07 UTC (rev 250440)
+++ trunk/Source/WebCore/ChangeLog	2019-09-27 19:48:05 UTC (rev 250441)
@@ -1,3 +1,20 @@
+2019-09-27  Jer Noble  <[email protected]>
+
+        [iOS] Vimeo fails to AirPlay in desktop mode
+        https://bugs.webkit.org/show_bug.cgi?id=202322
+
+        Reviewed by Eric Carlson.
+
+        Add a Quirk which opts Vimeo out of the preload=auto restriction, and allows their
+        second video element containing a HLS stream to correctly start AirPlaying when the
+        system route changes.
+
+        * html/HTMLMediaElement.cpp:
+        (WebCore::HTMLMediaElement::finishInitialization):
+        * page/Quirks.cpp:
+        (WebCore::Quirks::needsPreloadAutoQuirk const):
+        * page/Quirks.h:
+
 2019-09-27  Zalan Bujtas  <[email protected]>
 
         [LFC][IFC] Line::close should merge the text runs.

Modified: trunk/Source/WebCore/html/HTMLMediaElement.cpp (250440 => 250441)


--- trunk/Source/WebCore/html/HTMLMediaElement.cpp	2019-09-27 19:30:07 UTC (rev 250440)
+++ trunk/Source/WebCore/html/HTMLMediaElement.cpp	2019-09-27 19:48:05 UTC (rev 250441)
@@ -520,7 +520,7 @@
             m_mediaSession->addBehaviorRestriction(MediaElementSession::RequireUserGestureToShowPlaybackTargetPicker);
 #endif
 
-        if (!document.settings().mediaDataLoadsAutomatically())
+        if (!document.settings().mediaDataLoadsAutomatically() && !document.quirks().needsPreloadAutoQuirk())
             m_mediaSession->addBehaviorRestriction(MediaElementSession::AutoPreloadingNotPermitted);
 
         if (document.settings().mainContentUserGestureOverrideEnabled())

Modified: trunk/Source/WebCore/page/Quirks.cpp (250440 => 250441)


--- trunk/Source/WebCore/page/Quirks.cpp	2019-09-27 19:30:07 UTC (rev 250440)
+++ trunk/Source/WebCore/page/Quirks.cpp	2019-09-27 19:48:05 UTC (rev 250441)
@@ -579,4 +579,23 @@
 #endif
 }
 
+bool Quirks::needsPreloadAutoQuirk() const
+{
+#if PLATFORM(IOS_FAMILY)
+    if (!needsQuirks())
+        return false;
+
+    if (m_needsPreloadAutoQuirk)
+        return m_needsPreloadAutoQuirk.value();
+
+    auto domain = m_document->securityOrigin().domain().convertToASCIILowercase();
+
+    m_needsPreloadAutoQuirk = domain == "vimeo.com" || domain.endsWith("vimeo.com");
+
+    return m_needsPreloadAutoQuirk.value();
+#else
+    return false;
+#endif
 }
+
+}

Modified: trunk/Source/WebCore/page/Quirks.h (250440 => 250441)


--- trunk/Source/WebCore/page/Quirks.h	2019-09-27 19:30:07 UTC (rev 250440)
+++ trunk/Source/WebCore/page/Quirks.h	2019-09-27 19:48:05 UTC (rev 250441)
@@ -79,6 +79,8 @@
 
     bool shouldOpenAsAboutBlank(const String&) const;
 
+    bool needsPreloadAutoQuirk() const;
+
 private:
     bool needsQuirks() const;
 
@@ -93,6 +95,7 @@
 #if PLATFORM(IOS_FAMILY)
     mutable Optional<bool> m_needsGMailOverflowScrollQuirk;
     mutable Optional<bool> m_needsYouTubeOverflowScrollQuirk;
+    mutable Optional<bool> m_needsPreloadAutoQuirk;
 #endif
 };
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to