Bug 150906 - [iOS] Fullscreen -> PiP should resume to Fullscreen, not inline
Summary: [iOS] Fullscreen -> PiP should resume to Fullscreen, not inline
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Jer Noble
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2015-11-04 14:51 PST by Jer Noble
Modified: 2016-02-10 08:37 PST (History)
5 users (show)

See Also:


Attachments
Patch (38.39 KB, patch)
2015-11-05 14:33 PST, Jer Noble
no flags Details | Formatted Diff | Diff
Patch (38.48 KB, patch)
2015-11-05 16:58 PST, Jer Noble
simon.fraser: review+
Details | Formatted Diff | Diff
Patch for landing (38.08 KB, patch)
2015-12-02 15:45 PST, Jer Noble
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jer Noble 2015-11-04 14:51:17 PST
[iOS] Fullscreen -> PiP should resume to Fullscreen, not inline
Comment 1 Jer Noble 2015-11-05 14:33:25 PST
Created attachment 264883 [details]
Patch
Comment 2 WebKit Commit Bot 2015-11-05 14:35:09 PST
Attachment 264883 [details] did not pass style-queue:


ERROR: Source/WebCore/platform/ios/WebVideoFullscreenInterfaceAVKit.mm:1435:  Place brace on its own line for function definitions.  [whitespace/braces] [4]
Total errors found: 1 in 17 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 3 Jer Noble 2015-11-05 16:58:10 PST
Created attachment 264901 [details]
Patch
Comment 4 WebKit Commit Bot 2015-11-05 16:59:53 PST
Attachment 264901 [details] did not pass style-queue:


ERROR: Source/WebCore/platform/ios/WebVideoFullscreenInterfaceAVKit.mm:1435:  Place brace on its own line for function definitions.  [whitespace/braces] [4]
Total errors found: 1 in 17 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 5 Jon Lee 2015-11-12 11:38:35 PST
rdar://problem/20596271
Comment 6 Eric Carlson 2015-11-12 12:11:48 PST
Comment on attachment 264901 [details]
Patch

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

This looks fine to me, but a WK2 reviewer will need to give it an official r+.

> Source/WebCore/ChangeLog:22
> +        Add methods to for clients to request a specific fullscreen mode, and to query whether
> +        the page is currently visible.

Nit: "to for clients"?
Comment 7 Simon Fraser (smfr) 2015-11-18 14:29:18 PST
Comment on attachment 264901 [details]
Patch

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

> Source/WebCore/ChangeLog:8
> +        When "restoring" the user interface when exiting PiP, we should return to Fullscreen if that

"restoring" reads like butchers quotes.

> Source/WebCore/html/HTMLVideoElement.cpp:405
> +    LOG(Media, "HTMLVideoElement::webkitSetPresentationMode(%p) - setting to \"%s\"", this, mode.utf8().data());

You could LOG_STREAM(Media, stream << "HTMLVideoElement::webkitSetPresentationMode(" << this << ") - setting to " << mode);

> Source/WebCore/platform/ios/WebVideoFullscreenInterfaceAVKit.mm:657
>      if ([_videoSublayer superlayer] != self)
>          return;
>  
> -    [_videoSublayer setPosition:CGPointMake(CGRectGetMidX(bounds), CGRectGetMidY(bounds))];
> -    
>      if (![_avPlayerController delegate])
>          return;

Would be nice to wrap these checks in a function that describes what state you expect these to be true in.

> Source/WebCore/platform/ios/WebVideoFullscreenInterfaceAVKit.mm:838
> +    WebAVPlayerLayer *pipPlayerLayer = (WebAVPlayerLayer *)[pipView layer];

Do we know that [pipView layer] is always a WebAVPlayerLayer? Could some other framework break this under us?
Comment 8 Jer Noble 2015-12-02 14:49:43 PST
(In reply to comment #7)
> Comment on attachment 264901 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=264901&action=review
> 
> > Source/WebCore/ChangeLog:8
> > +        When "restoring" the user interface when exiting PiP, we should return to Fullscreen if that
> 
> "restoring" reads like butchers quotes.

Okay, I'll "remove" them.

> > Source/WebCore/html/HTMLVideoElement.cpp:405
> > +    LOG(Media, "HTMLVideoElement::webkitSetPresentationMode(%p) - setting to \"%s\"", this, mode.utf8().data());
> 
> You could LOG_STREAM(Media, stream <<
> "HTMLVideoElement::webkitSetPresentationMode(" << this << ") - setting to "
> << mode);

Nice!

> > Source/WebCore/platform/ios/WebVideoFullscreenInterfaceAVKit.mm:657
> >      if ([_videoSublayer superlayer] != self)
> >          return;
> >  
> > -    [_videoSublayer setPosition:CGPointMake(CGRectGetMidX(bounds), CGRectGetMidY(bounds))];
> > -    
> >      if (![_avPlayerController delegate])
> >          return;
> 
> Would be nice to wrap these checks in a function that describes what state
> you expect these to be true in.
> 
> > Source/WebCore/platform/ios/WebVideoFullscreenInterfaceAVKit.mm:838
> > +    WebAVPlayerLayer *pipPlayerLayer = (WebAVPlayerLayer *)[pipView layer];
> 
> Do we know that [pipView layer] is always a WebAVPlayerLayer? Could some
> other framework break this under us?

Yes. The PiP view will always have a WebAVPlayerLayer because WebAVPictureInPicturePlayerLayerView has a -layerClass member which returns [WebAVPlayerLayer class].
Comment 9 Jer Noble 2015-12-02 15:45:17 PST
Created attachment 266482 [details]
Patch for landing
Comment 10 WebKit Commit Bot 2015-12-02 15:53:31 PST
Attachment 266482 [details] did not pass style-queue:


ERROR: Source/WebCore/platform/ios/WebVideoFullscreenInterfaceAVKit.mm:1434:  Place brace on its own line for function definitions.  [whitespace/braces] [4]
Total errors found: 1 in 17 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 11 WebKit Commit Bot 2015-12-03 11:12:41 PST
Comment on attachment 266482 [details]
Patch for landing

Clearing flags on attachment: 266482

Committed r193340: <http://trac.webkit.org/changeset/193340>