| Summary: | [iOS] Add a wrapper around the hosted AVPlayerLayer to intercept -setBounds: | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Product: | WebKit | Reporter: | Jer Noble <jer.noble> | ||||||||
| Component: | New Bugs | Assignee: | Jer Noble <jer.noble> | ||||||||
| Status: | RESOLVED FIXED | ||||||||||
| Severity: | Normal | CC: | billmartinnn, webkit-bug-importer | ||||||||
| Priority: | P2 | Keywords: | InRadar | ||||||||
| Version: | 528+ (Nightly build) | ||||||||||
| Hardware: | Unspecified | ||||||||||
| OS: | Unspecified | ||||||||||
| Attachments: |
|
||||||||||
|
Description
Jer Noble
2015-04-23 15:24:36 PDT
Created attachment 251502 [details]
Patch
Created attachment 251505 [details]
Patch
Created attachment 251506 [details]
Patch
Comment on attachment 251506 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=251506&action=review > Source/WebCore/platform/ios/WebVideoFullscreenInterfaceAVKit.mm:592 > + [super setBounds:bounds]; > + This should probably early-return when the bounds aren't changing. > Source/WebCore/platform/ios/WebVideoFullscreenInterfaceAVKit.mm:612 > + FloatRect videoFrame = self.model->videoLayerFrame(); > + FloatRect targetFrame; > + switch (self.model->videoLayerGravity()) { > + case WebCore::WebVideoFullscreenModel::VideoGravityResize: > + targetFrame = bounds; > + break; > + case WebCore::WebVideoFullscreenModel::VideoGravityResizeAspect: > + targetFrame = largestRectWithAspectRatioInsideRect(videoFrame.size().aspectRatio(), bounds); > + break; > + case WebCore::WebVideoFullscreenModel::VideoGravityResizeAspectFill: > + targetFrame = smallestRectWithAspectRatioAroundRect(videoFrame.size().aspectRatio(), bounds); > + break; > + } > + CATransform3D transform = CATransform3DMakeScale(targetFrame.width() / videoFrame.width(), targetFrame.height() / videoFrame.height(), 1); > + [_videoSublayer setSublayerTransform:transform]; Doing all this inside -setBounds makes me slightly nervous, but it's probably OK. > Source/WebCore/platform/ios/WebVideoFullscreenInterfaceAVKit.mm:615 > + [self performSelector:@selector(resolveBounds) withObject:nil afterDelay:[CATransaction animationDuration] + 0.1]; Add a comment to explain the magic + 0.1? Committed r183229: <http://trac.webkit.org/changeset/183229> |