WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
132603
[iOS] Animate AVPlayerLayer into and out of full screen
https://bugs.webkit.org/show_bug.cgi?id=132603
Summary
[iOS] Animate AVPlayerLayer into and out of full screen
Jer Noble
Reported
2014-05-06 02:06:21 PDT
[iOS] Animate AVPlayerLayer into and out of full screen
Attachments
Patch
(5.04 KB, patch)
2014-05-06 02:10 PDT
,
Jer Noble
simon.fraser
: review+
Details
Formatted Diff
Diff
Patch for landing.
(8.30 KB, patch)
2014-05-06 14:16 PDT
,
Jer Noble
no flags
Details
Formatted Diff
Diff
View All
Add attachment
proposed patch, testcase, etc.
Jer Noble
Comment 1
2014-05-06 02:10:34 PDT
Created
attachment 230893
[details]
Patch
Jer Noble
Comment 2
2014-05-06 02:11:14 PDT
<
rdar://problem/16778157
>
Simon Fraser (smfr)
Comment 3
2014-05-06 12:39:46 PDT
Comment on
attachment 230893
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=230893&action=review
> Source/WebCore/platform/ios/WebVideoFullscreenInterfaceAVKit.mm:354 > +- (id)init
instancetype?
> Source/WebCore/platform/ios/WebVideoFullscreenInterfaceAVKit.mm:359 > + self.masksToBounds = YES; > + self.videoLayerGravity = AVVideoLayerGravityResizeAspect;
Shouldn't use property syntax in the init method.
> Source/WebCore/platform/ios/WebVideoFullscreenInterfaceAVKit.mm:380 > +static FloatRect largestRectWithAspectRatioInsideRect(float aspectRatio, FloatRect rect) > +{ > + if (aspectRatio > rect.size().aspectRatio()) { > + float dy = rect.width() / aspectRatio - rect.height(); > + rect.inflateY(dy / 2); > + } else { > + float dx = rect.height() * aspectRatio - rect.width(); > + rect.inflateX(dx / 2); > + } > + return rect; > +}
Pretty sure we have code elsewhere that does aspect-ratio sizing.
> Source/WebCore/platform/ios/WebVideoFullscreenInterfaceAVKit.mm:392 > + FloatRect rootBounds; > + CALayer *parent = self; > + while ((parent = [parent superlayer])) > + rootBounds = [parent bounds];
This is weird. How do you know how far up you're walking? Which rect do you actually want?
Jer Noble
Comment 4
2014-05-06 13:21:32 PDT
(In reply to
comment #3
)
> (From update of
attachment 230893
[details]
) > View in context:
https://bugs.webkit.org/attachment.cgi?id=230893&action=review
> > > Source/WebCore/platform/ios/WebVideoFullscreenInterfaceAVKit.mm:354 > > +- (id)init > > instancetype?
Changed.
> > Source/WebCore/platform/ios/WebVideoFullscreenInterfaceAVKit.mm:359 > > + self.masksToBounds = YES; > > + self.videoLayerGravity = AVVideoLayerGravityResizeAspect; > > Shouldn't use property syntax in the init method.
Changed.
> > Source/WebCore/platform/ios/WebVideoFullscreenInterfaceAVKit.mm:380 > > +static FloatRect largestRectWithAspectRatioInsideRect(float aspectRatio, FloatRect rect) > > +{ > > + if (aspectRatio > rect.size().aspectRatio()) { > > + float dy = rect.width() / aspectRatio - rect.height(); > > + rect.inflateY(dy / 2); > > + } else { > > + float dx = rect.height() * aspectRatio - rect.width(); > > + rect.inflateX(dx / 2); > > + } > > + return rect; > > +} > > Pretty sure we have code elsewhere that does aspect-ratio sizing.
We do (in RenderReplaced), but it's not generic. I'll add this to GeometryUtils.h.
> > Source/WebCore/platform/ios/WebVideoFullscreenInterfaceAVKit.mm:392 > > + FloatRect rootBounds; > > + CALayer *parent = self; > > + while ((parent = [parent superlayer])) > > + rootBounds = [parent bounds]; > > This is weird. How do you know how far up you're walking? Which rect do you actually want?
We're looking for our window's root UIViewController's view's bounds. I'll change this to pass in the view controller, and query it directly.
Jer Noble
Comment 5
2014-05-06 14:16:52 PDT
Created
attachment 230931
[details]
Patch for landing.
Jer Noble
Comment 6
2014-05-06 16:36:49 PDT
Committed
r168392
: <
http://trac.webkit.org/changeset/168392
>
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug