[webkit-changes] [WebKit/WebKit] 0a8efe: [visionOS] Videos on apple.com are not shown in co...

Aditya Keerthi noreply at github.com
Thu Aug 10 14:14:26 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 0a8efe4a7da6d481bcd89a820c5e0e75078d7578
      https://github.com/WebKit/WebKit/commit/0a8efe4a7da6d481bcd89a820c5e0e75078d7578
  Author: Aditya Keerthi <akeerthi at apple.com>
  Date:   2023-08-10 (Thu, 10 Aug 2023)

  Changed paths:
    M Source/WebKit/UIProcess/ios/WebPageProxyIOS.mm

  Log Message:
  -----------
  [visionOS] Videos on apple.com are not shown in compatibility mode when using a mobile UA
https://bugs.webkit.org/show_bug.cgi?id=260027
rdar://112638189

Reviewed by Mike Wyrzykowski, Megan Gardner and Tim Horton.

apple.com product pages (like https://www.apple.com/apple-vision-pro/) often
have a "Watch the film" button that displays a video and begins playback.

Depending on the user agent, as well as the relationship between screen
size (`Screen.availWidth` and `Screen.availHeight`) and viewport size, apple.com
uses different logic (JavaScript + DOM structure) for the video flow.

On the mobile site, apple.com simply begins playback on a 1x1 <video>. On iPhone,
this results in the video entering fullscreen automatically, as the `playsinline`
is missing. On the desktop site, apple.com simply shows the video inline, and sizes
it to fill the viewport.

Importantly, a mobile UA is not enough to get apple.com's mobile site, they also
account for screen size. Due to our screen size override on visionOS, added in
258005 at main, and the fact that apps running compatibility mode report other sizes
as if they were an iPad, apple.com ends up using the mobile logic. This logic
fails, as visionOS/iPadOS do not have automatic fullscreen on playback, leaving
a 1x1 <video> element behind.

To fix, do not apply the screen size override in compatibility mode. Apps in
compatibility mode have the exact same fullscreen behavior as iPad, and the
fix in 258005 at main is unnecessary there.

Note that the same bug can occur in Safari, depending on the size the window
is resized to. However, that is an existing site issue that will require a
fix by apple.com.

* Source/WebKit/UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::availableScreenSize):
(WebKit::WebPageProxy::overrideScreenSize):

Canonical link: https://commits.webkit.org/266780@main




More information about the webkit-changes mailing list