[webkit-changes] [WebKit/WebKit] d409ef: [visionOS] Videos on youtube.com are cropped in co...

Aditya Keerthi noreply at github.com
Tue Aug 15 11:38:17 PDT 2023


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

  Changed paths:
    M Source/WebCore/html/HTMLMediaElement.cpp

  Log Message:
  -----------
  [visionOS] Videos on youtube.com are cropped in compatibility mode when using a mobile UA
https://bugs.webkit.org/show_bug.cgi?id=260192
rdar://112444285

Reviewed by Mike Wyrzykowski and Richard Robinson.

Unlike the desktop site, YouTube's mobile site fullscreens the <video> element
rather than an element containing the <video>. Currently, on visionOS, WebKit
always uses element fullscreen (rather than the native player) when playing
fullscreen <video>. However, this results in cropping on YouTube's mobile site
as YouTube sets `object-fit: cover` on the <video>. On iPadOS, this CSS would
have no observable effect, as the native player is used.

This issue does not reproduce with YouTube's mobile site in Safari on visionOS,
even though element fullscreen is enforced, as the fullscreen window's aspect
ratio matches the <video>.

However, in compatibility mode, the fullscreen behavior should match iPadOS.
Fix by ensuring element fullscreen is not forced for <video> fullscreen in
compatibility mode.

* Source/WebCore/html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::enterFullscreen):

Use the existing `videoFullscreenRequiresElementFullscreen` to determine whether
to force element fullscreen for <video>. This flag is only true when running on
visionOS, and compatibility mode is not active.

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




More information about the webkit-changes mailing list