WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
129870
Allow media element to supply the video layer after fullscreen transition has already begun.
https://bugs.webkit.org/show_bug.cgi?id=129870
Summary
Allow media element to supply the video layer after fullscreen transition has...
Jeremy Jones
Reported
2014-03-07 02:09:45 PST
Allow media element to supply the video layer after fullscreen transition has already begun.
Attachments
Patch
(71.64 KB, patch)
2014-03-07 03:45 PST
,
Jeremy Jones
no flags
Details
Formatted Diff
Diff
Patch
(72.65 KB, patch)
2014-03-07 11:53 PST
,
Jeremy Jones
no flags
Details
Formatted Diff
Diff
Patch
(71.63 KB, patch)
2014-03-07 15:58 PST
,
Jeremy Jones
no flags
Details
Formatted Diff
Diff
Show Obsolete
(2)
View All
Add attachment
proposed patch, testcase, etc.
Jeremy Jones
Comment 1
2014-03-07 03:45:12 PST
Created
attachment 226110
[details]
Patch
Eric Carlson
Comment 2
2014-03-07 09:36:48 PST
Comment on
attachment 226110
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=226110&action=review
> Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:758 > + void MediaPlayerPrivateAVFoundationObjC::setVideoFullscreenGravity(MediaPlayer::VideoGravity gravity)
Nit: you don't need this indentation.
> Source/WebKit2/WebProcess/ios/WebVideoFullscreenManager.mm:135 > + exitFullscreenForNode(m_node.get());
"exitFullscreenForNode" called from didEnterFullscreen?
> Source/WebKit2/WebProcess/ios/WebVideoFullscreenManager.mm:156 > + enterFullscreenForNode(m_node.get());
"enterFullscreenForNode" called from didExitFullscreen?
> Source/WebKit2/WebProcess/ios/WebVideoFullscreenManager.mm:166 > +
Nit: extra blank line.
Jon Lee
Comment 3
2014-03-07 10:29:01 PST
Comment on
attachment 226110
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=226110&action=review
> Source/WebCore/ChangeLog:35 > + Stash the gravity propety, pass it along to the media player if possible.
property*
> Source/WebCore/html/HTMLMediaElement.h:800 > + RetainPtr<PlatformLayer> m_videoFullscreenLayer;
Should these variables be moved after the flags?
> Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:501 > + {
Brace on same line as "if"
>> Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:758 >> + void MediaPlayerPrivateAVFoundationObjC::setVideoFullscreenGravity(MediaPlayer::VideoGravity gravity) > > Nit: you don't need this indentation.
Remove excess indentation
> Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:764 > + NSString* videoGravity = AVLayerVideoGravityResizeAspect;
NSString *videoGravity
> Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:768 > + videoGravity = AVLayerVideoGravityResize;
It seems this might be slightly better: switch (gravity) { case VideoGravityResizeAspectFill: videoGravity = AVLayerVideoGravityResizeAspectFill; break; … default: ASSERT_NOT_REACHED(); } only in that any additional modes would trigger an assert.
> Source/WebCore/platform/ios/WebVideoFullscreenInterfaceAVKit.mm:201 > + _avPlayerController = (WebAVPlayerController*)playerController;
missing space: (WebAVPlayerController *)playerController
> Source/WebCore/platform/ios/WebVideoFullscreenInterfaceAVKit.mm:215 > + {
There's enough of the consequent clause here to return early to avoid the indentation.
> Source/WebCore/platform/ios/WebVideoFullscreenModel.h:45 > + enum VideoGravity { VideoGravityReize, VideoGravityResizeAspect, VideoGravityResizeAspectFill};
Missing space separating last enum from brace
> Source/WebCore/platform/ios/WebVideoFullscreenModelMediaElement.mm:94 > + else
Our style puts the concluding brace and "else" on the same line.
> Source/WebCore/platform/ios/WebVideoFullscreenModelMediaElement.mm:176 > + [m_videoFullscreenLayer setFrame:CGRectMake(rect.x(), rect.y(), rect.width(), rect.height())];
You can use CGRect(rect) here. (See FloatRectCG.cpp)
> Source/WebCore/platform/ios/WebVideoFullscreenModelMediaElement.mm:186 > + videoGravity = MediaPlayer::VideoGravityResizeAspectFill;
same thing here re: switch statement
> Source/WebKit2/UIProcess/ios/WebVideoFullscreenManagerProxy.mm:108 > +
Remove excess space.
> Source/WebKit2/UIProcess/ios/WebVideoFullscreenManagerProxy.mm:113 > +
Ditto
> Source/WebKit2/WebProcess/ios/WebVideoFullscreenManager.mm:70 > + return isHTMLVideoElement(node);
Would be clearer to write this simply as return Settings::avKitEnabled() && isHTMLVideoElement(node);
Jon Lee
Comment 4
2014-03-07 10:30:30 PST
<
rdar://problem/16207968
>
Jeremy Jones
Comment 5
2014-03-07 11:23:39 PST
(In reply to
comment #2
)
> (From update of
attachment 226110
[details]
) > View in context:
https://bugs.webkit.org/attachment.cgi?id=226110&action=review
> > > Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:758 > > + void MediaPlayerPrivateAVFoundationObjC::setVideoFullscreenGravity(MediaPlayer::VideoGravity gravity) > > Nit: you don't need this indentation.
Done.
> > > Source/WebKit2/WebProcess/ios/WebVideoFullscreenManager.mm:135 > > + exitFullscreenForNode(m_node.get()); > > "exitFullscreenForNode" called from didEnterFullscreen?
Surprising but intended. This handles the case the exitFullScreen was called while animating into fullscreen.
> > > Source/WebKit2/WebProcess/ios/WebVideoFullscreenManager.mm:156 > > + enterFullscreenForNode(m_node.get()); > > "enterFullscreenForNode" called from didExitFullscreen?
Ditto.
> > > Source/WebKit2/WebProcess/ios/WebVideoFullscreenManager.mm:166 > > + > > Nit: extra blank line.
Done.
Jeremy Jones
Comment 6
2014-03-07 11:36:01 PST
(In reply to
comment #3
)
> (From update of
attachment 226110
[details]
) > View in context:
https://bugs.webkit.org/attachment.cgi?id=226110&action=review
> > > Source/WebCore/ChangeLog:35 > > + Stash the gravity propety, pass it along to the media player if possible. > > property*
Done.
> > > Source/WebCore/html/HTMLMediaElement.h:800 > > + RetainPtr<PlatformLayer> m_videoFullscreenLayer; > > Should these variables be moved after the flags?
I moved this and moved the initializer to match the order.
> > > Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:501 > > + { > > Brace on same line as "if"
Done.
> > >> Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:758 > >> + void MediaPlayerPrivateAVFoundationObjC::setVideoFullscreenGravity(MediaPlayer::VideoGravity gravity) > > > > Nit: you don't need this indentation. > > Remove excess indentation
Done.
> > > Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:764 > > + NSString* videoGravity = AVLayerVideoGravityResizeAspect; > > NSString *videoGravity
Done.
> > > Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:768 > > + videoGravity = AVLayerVideoGravityResize; > > It seems this might be slightly better: > > switch (gravity) { > case VideoGravityResizeAspectFill: > videoGravity = AVLayerVideoGravityResizeAspectFill; > break; > … > default: > ASSERT_NOT_REACHED(); > }
Done, using an else clause.
> > only in that any additional modes would trigger an assert. > > > Source/WebCore/platform/ios/WebVideoFullscreenInterfaceAVKit.mm:201 > > + _avPlayerController = (WebAVPlayerController*)playerController; > > missing space: (WebAVPlayerController *)playerController
Done.
> > > Source/WebCore/platform/ios/WebVideoFullscreenInterfaceAVKit.mm:215 > > + { > > There's enough of the consequent clause here to return early to avoid the indentation.
Done.
> > > Source/WebCore/platform/ios/WebVideoFullscreenModel.h:45 > > + enum VideoGravity { VideoGravityReize, VideoGravityResizeAspect, VideoGravityResizeAspectFill}; > > Missing space separating last enum from brace
Done. And fixed another occurrence of this in MediaPlayer. And fixed typo VideoGravityResize
> > > Source/WebCore/platform/ios/WebVideoFullscreenModelMediaElement.mm:94 > > + else > > Our style puts the concluding brace and "else" on the same line.
Done.
> > > Source/WebCore/platform/ios/WebVideoFullscreenModelMediaElement.mm:176 > > + [m_videoFullscreenLayer setFrame:CGRectMake(rect.x(), rect.y(), rect.width(), rect.height())]; > > You can use CGRect(rect) here. (See FloatRectCG.cpp)
Done.
> > > Source/WebCore/platform/ios/WebVideoFullscreenModelMediaElement.mm:186 > > + videoGravity = MediaPlayer::VideoGravityResizeAspectFill; > > same thing here re: switch statement
Done, using an else. Also fixed same pattern in WebAVVideoLayer.
> > > Source/WebKit2/UIProcess/ios/WebVideoFullscreenManagerProxy.mm:108 > > + > > Remove excess space.
Done.
> > > Source/WebKit2/UIProcess/ios/WebVideoFullscreenManagerProxy.mm:113 > > + > > Ditto
Ditto.
> > > Source/WebKit2/WebProcess/ios/WebVideoFullscreenManager.mm:70 > > + return isHTMLVideoElement(node); > > Would be clearer to write this simply as > > return Settings::avKitEnabled() && isHTMLVideoElement(node);
Done.
Eric Carlson
Comment 7
2014-03-07 11:41:04 PST
Comment on
attachment 226110
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=226110&action=review
>>> Source/WebKit2/WebProcess/ios/WebVideoFullscreenManager.mm:135 >>> + exitFullscreenForNode(m_node.get()); >> >> "exitFullscreenForNode" called from didEnterFullscreen? > > Surprising but intended. This handles the case the exitFullScreen was called while animating into fullscreen.
It probably deserves an explanatory comment, others will probably misunderstand this as well.
>>> Source/WebKit2/WebProcess/ios/WebVideoFullscreenManager.mm:156 >>> + enterFullscreenForNode(m_node.get()); >> >> "enterFullscreenForNode" called from didExitFullscreen? > > Ditto.
Ditto.
Jeremy Jones
Comment 8
2014-03-07 11:53:05 PST
Created
attachment 226144
[details]
Patch
Simon Fraser (smfr)
Comment 9
2014-03-07 15:50:55 PST
r+ (bugzilla is broken)
Simon Fraser (smfr)
Comment 10
2014-03-07 15:53:09 PST
Test
Jeremy Jones
Comment 11
2014-03-07 15:57:44 PST
(In reply to
comment #7
)
> (From update of
attachment 226110
[details]
) > View in context:
https://bugs.webkit.org/attachment.cgi?id=226110&action=review
> > >>> Source/WebKit2/WebProcess/ios/WebVideoFullscreenManager.mm:135 > >>> + exitFullscreenForNode(m_node.get()); > >> > >> "exitFullscreenForNode" called from didEnterFullscreen? > > > > Surprising but intended. This handles the case the exitFullScreen was called while animating into fullscreen. > > It probably deserves an explanatory comment, others will probably misunderstand this as well. > > >>> Source/WebKit2/WebProcess/ios/WebVideoFullscreenManager.mm:156 > >>> + enterFullscreenForNode(m_node.get()); > >> > >> "enterFullscreenForNode" called from didExitFullscreen? > > > > Ditto. > > Ditto.
Added comments.
Jeremy Jones
Comment 12
2014-03-07 15:58:19 PST
(In reply to
comment #9
)
> r+ (bugzilla is broken)
I'm submitting a rebased version to prevent a merge conflict.
Jeremy Jones
Comment 13
2014-03-07 15:58:56 PST
Created
attachment 226178
[details]
Patch
Eric Carlson
Comment 14
2014-03-08 17:38:21 PST
Comment on
attachment 226178
[details]
Patch Marking r+ based on Simon's earlier review.
WebKit Commit Bot
Comment 15
2014-03-08 18:10:26 PST
Comment on
attachment 226178
[details]
Patch Clearing flags on attachment: 226178 Committed
r165344
: <
http://trac.webkit.org/changeset/165344
>
WebKit Commit Bot
Comment 16
2014-03-08 18:10:33 PST
All reviewed patches have been landed. Closing bug.
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