⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 267372 in webkit


Ignore:
Timestamp:
Sep 21, 2020, 3:03:44 PM (6 years ago)
Author:
Peng Liu
Message:

Tapping to zoom in and out causes video to become very small on some iPhone models
https://bugs.webkit.org/show_bug.cgi?id=216635

Reviewed by Jer Noble.

  • 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.

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r267369 r267372  
     12020-09-21  Peng Liu  <peng.liu6@apple.com>
     2
     3        Tapping to zoom in and out causes video to become very small on some iPhone models
     4        https://bugs.webkit.org/show_bug.cgi?id=216635
     5
     6        Reviewed by Jer Noble.
     7
     8        * platform/ios/VideoFullscreenInterfaceAVKit.mm:
     9        (-[WebAVPlayerLayer resolveBounds]): On some iPhone models, AVKit does not
     10        change "bounds" of WebAVPlayerLayer after changing its video gravity. Therefore,
     11        in this function, "modelVideoLayerFrame" and "bounds" might be the same. But we
     12        still need to update the video layer frame in the Web process.
     13
     14        (-[WebAVPlayerLayer setVideoGravity:]): On some iPhone models, AVKit does
     15        not call -[WebAVPlayerLayer:layoutSublayers] immediately after changing
     16        the video gravity. Forcing a layout can fix that.
     17
    1182020-09-21  Jiewen Tan  <jiewen_tan@apple.com>
    219
  • trunk/Source/WebCore/platform/ios/VideoFullscreenInterfaceAVKit.mm

    r267053 r267372  
    333333    [CATransaction setAnimationDuration:0];
    334334    [CATransaction setDisableActions:YES];
    335    
    336     if (!CGRectEqualToRect(self.modelVideoLayerFrame, [self bounds])) {
    337         self.modelVideoLayerFrame = [self bounds];
    338         if (auto* model = _fullscreenInterface->videoFullscreenModel())
    339             model->setVideoLayerFrame(_videoSublayerFrame);
    340 
    341         _previousVideoGravity = _videoGravity;
    342     }
     335
     336    self.modelVideoLayerFrame = [self bounds];
     337    if (auto* model = _fullscreenInterface->videoFullscreenModel())
     338        model->setVideoLayerFrame(_videoSublayerFrame);
     339
     340    _previousVideoGravity = _videoGravity;
     341
    343342    [(UIView *)[_videoSublayer delegate] setTransform:CGAffineTransformIdentity];
    344343   
     
    375374    if (auto* model = _fullscreenInterface->videoFullscreenModel())
    376375        model->setVideoLayerGravity(gravity);
     376
     377    [self setNeedsLayout];
    377378}
    378379
Note: See TracChangeset for help on using the changeset viewer.