Bug 216635 - Tapping to zoom in and out causes video to become very small on some iPhone models
Summary: Tapping to zoom in and out causes video to become very small on some iPhone m...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Media (show other bugs)
Version: WebKit Nightly Build
Hardware: iPhone / iPad Unspecified
: P2 Normal
Assignee: Peng Liu
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2020-09-16 20:41 PDT by Peng Liu
Modified: 2020-09-21 15:03 PDT (History)
8 users (show)

See Also:


Attachments
Patch (2.71 KB, patch)
2020-09-16 21:20 PDT, Peng Liu
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Peng Liu 2020-09-16 20:41:54 PDT
Tapping to zoom in and out causes video to become very small on some iPhone models
Comment 1 Peng Liu 2020-09-16 20:42:31 PDT
<rdar://67870169>
Comment 2 Peng Liu 2020-09-16 21:20:15 PDT
Created attachment 408988 [details]
Patch
Comment 3 Sam Weinig 2020-09-17 10:06:34 PDT
Comment on attachment 408988 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=408988&action=review

> Source/WebCore/ChangeLog:16
> +        * platform/ios/VideoFullscreenInterfaceAVKit.mm:
> +        (-[WebAVPlayerLayer resolveBounds]): On some iPhone models, AVKit does not
> +        change "bounds" of WebAVPlayerLayer after changing its video gravity. Therefore,
> +        in this function, "modelVideoLayerFrame" and "bounds" might be the same. But we
> +        still need to update the video layer frame in the Web process.
> +
> +        (-[WebAVPlayerLayer setVideoGravity:]): On some iPhone models, AVKit does
> +        not call -[WebAVPlayerLayer:layoutSublayers] immediately after changing
> +        the video gravity. Forcing a layout can fix that.

How can this be tested?
Comment 4 Peng Liu 2020-09-17 10:37:46 PDT
Comment on attachment 408988 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=408988&action=review

>> Source/WebCore/ChangeLog:16
>> +        the video gravity. Forcing a layout can fix that.
> 
> How can this be tested?

To write a regression test, we need to expose the "video gravity" and "video fullscreen frame" of a video element through the "Internals" interface.

However, for a layout test, we have to disable the "mock video presentation mode". Otherwise, the test may conflict with any other video fullscreen or picture-in-picture test. But we cannot test this patch if "mock video presentation mode" is disabled.

Let me try to write an API test.
Comment 5 Peng Liu 2020-09-17 13:42:00 PDT
Just realized that we have to land the patch for bug 216426 first. The patch for bug 216426 will improve the mechanism to implement reliable tests regarding video fullscreen and picture-in-picture.
Comment 6 Peng Liu 2020-09-17 17:38:10 PDT
Because of bug 212654, TestWebKitAPI on iOS cannot test the video fullscreen feature properly. We have to enable the "mock video presentation mode", with which we cannot test the video gravity setting. I am afraid we have to defer the regression test development for this bug.
Comment 7 EWS 2020-09-21 15:03:49 PDT
Committed r267372: <https://trac.webkit.org/changeset/267372>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 408988 [details].