Bug 144871 - Do not exit fullscreen when starting optimized fullscreen since this is done automatically.
Summary: Do not exit fullscreen when starting optimized fullscreen since this is done ...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Media (show other bugs)
Version: 528+ (Nightly build)
Hardware: iPhone / iPad Unspecified
: P2 Normal
Assignee: Jeremy Jones
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2015-05-11 08:04 PDT by Jeremy Jones
Modified: 2015-06-22 11:18 PDT (History)
4 users (show)

See Also:


Attachments
Patch (2.35 KB, patch)
2015-05-11 08:05 PDT, Jeremy Jones
no flags Details | Formatted Diff | Diff
Patch (6.83 KB, patch)
2015-06-18 22:19 PDT, Jeremy Jones
no flags Details | Formatted Diff | Diff
Patch (8.19 KB, patch)
2015-06-19 14:44 PDT, Jeremy Jones
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jeremy Jones 2015-05-11 08:04:26 PDT
Do not exit fullscreen when starting optimized fullscreen since this is done automatically.
Comment 1 Jeremy Jones 2015-05-11 08:05:49 PDT
Created attachment 252860 [details]
Patch
Comment 2 Jeremy Jones 2015-05-11 08:06:36 PDT
rdar://problem/20719473
Comment 3 Jeremy Jones 2015-05-11 08:07:05 PDT
rdar://problem/20719473
Comment 4 Jeremy Jones 2015-06-18 22:19:45 PDT
Created attachment 255173 [details]
Patch
Comment 5 Darin Adler 2015-06-19 11:29:02 PDT
Comment on attachment 255173 [details]
Patch

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

Is there a way to make a regression test for this?

> Source/WebCore/platform/ios/WebVideoFullscreenInterfaceAVKit.h:108
> +    typedef enum {
> +        ExitFullScreenReasonDoneButtonTapped,
> +        ExitFullScreenReasonFullScreenButtonTapped,
> +        ExitFullScreenReasonPinchGestureHandled,
> +        ExitFullScreenReasonRemoteControlStopEventReceived,
> +        ExitFullScreenReasonPictureInPictureStarted
> +    } ExitFullscreenReason;

That’s C style. C++ style would be:

    enum ExitFullScreenReason {
        ExitFullScreenReasonDoneButtonTapped
        ...
    };

And modern C++ style would be:

    enum class ExitFullScreenReason {
        DoneButtonTapped
        ...
    };

Please use one of those styles.

> Source/WebCore/platform/ios/WebVideoFullscreenInterfaceAVKit.mm:245
> +    WebVideoFullscreenInterfaceAVKit::ExitFullscreenReason exitReason;
> +    switch (reason) {
> +    case AVPlayerViewControllerExitFullScreenReasonDoneButtonTapped:
> +        exitReason = WebVideoFullscreenInterfaceAVKit::ExitFullScreenReasonDoneButtonTapped;
> +        break;
> +    case AVPlayerViewControllerExitFullScreenReasonFullScreenButtonTapped:
> +        exitReason = WebVideoFullscreenInterfaceAVKit::ExitFullScreenReasonFullScreenButtonTapped;
> +        break;
> +    case AVPlayerViewControllerExitFullScreenReasonPictureInPictureStarted:
> +        exitReason = WebVideoFullscreenInterfaceAVKit::ExitFullScreenReasonPictureInPictureStarted;
> +        break;
> +    case AVPlayerViewControllerExitFullScreenReasonPinchGestureHandled:
> +        exitReason = WebVideoFullscreenInterfaceAVKit::ExitFullScreenReasonPinchGestureHandled;
> +        break;
> +    case AVPlayerViewControllerExitFullScreenReasonRemoteControlStopEventReceived:
> +        exitReason = WebVideoFullscreenInterfaceAVKit::ExitFullScreenReasonRemoteControlStopEventReceived;
> +        break;
> +    }

Seems like we should factor this out into a helper function that makes the AVPlayerViewController codes to the WebVideoFullscreenInterfaceAVKit ones and does nothing else.

Build failed on iOS; I think the codes might be different iOS vs. Mac or iOS 8 vs. iOS 9.
Comment 6 Jeremy Jones 2015-06-19 14:44:37 PDT
Created attachment 255227 [details]
Patch
Comment 7 Jeremy Jones 2015-06-19 14:46:28 PDT
(In reply to comment #5)
> Comment on attachment 255173 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=255173&action=review
> 
> Is there a way to make a regression test for this?
> 
> > Source/WebCore/platform/ios/WebVideoFullscreenInterfaceAVKit.h:108
> > +    typedef enum {
> > +        ExitFullScreenReasonDoneButtonTapped,
> > +        ExitFullScreenReasonFullScreenButtonTapped,
> > +        ExitFullScreenReasonPinchGestureHandled,
> > +        ExitFullScreenReasonRemoteControlStopEventReceived,
> > +        ExitFullScreenReasonPictureInPictureStarted
> > +    } ExitFullscreenReason;
> 
> That’s C style. C++ style would be:
> 
>     enum ExitFullScreenReason {
>         ExitFullScreenReasonDoneButtonTapped
>         ...
>     };
> 
> And modern C++ style would be:
> 
>     enum class ExitFullScreenReason {
>         DoneButtonTapped
>         ...
>     };
> 
> Please use one of those styles.

Updated to Modern C++ style.

> 
> > Source/WebCore/platform/ios/WebVideoFullscreenInterfaceAVKit.mm:245
> > +    WebVideoFullscreenInterfaceAVKit::ExitFullscreenReason exitReason;
> > +    switch (reason) {
> > +    case AVPlayerViewControllerExitFullScreenReasonDoneButtonTapped:
> > +        exitReason = WebVideoFullscreenInterfaceAVKit::ExitFullScreenReasonDoneButtonTapped;
> > +        break;
> > +    case AVPlayerViewControllerExitFullScreenReasonFullScreenButtonTapped:
> > +        exitReason = WebVideoFullscreenInterfaceAVKit::ExitFullScreenReasonFullScreenButtonTapped;
> > +        break;
> > +    case AVPlayerViewControllerExitFullScreenReasonPictureInPictureStarted:
> > +        exitReason = WebVideoFullscreenInterfaceAVKit::ExitFullScreenReasonPictureInPictureStarted;
> > +        break;
> > +    case AVPlayerViewControllerExitFullScreenReasonPinchGestureHandled:
> > +        exitReason = WebVideoFullscreenInterfaceAVKit::ExitFullScreenReasonPinchGestureHandled;
> > +        break;
> > +    case AVPlayerViewControllerExitFullScreenReasonRemoteControlStopEventReceived:
> > +        exitReason = WebVideoFullscreenInterfaceAVKit::ExitFullScreenReasonRemoteControlStopEventReceived;
> > +        break;
> > +    }
> 
> Seems like we should factor this out into a helper function that makes the
> AVPlayerViewController codes to the WebVideoFullscreenInterfaceAVKit ones
> and does nothing else.

Done.

> 
> Build failed on iOS; I think the codes might be different iOS vs. Mac or iOS
> 8 vs. iOS 9.

Added Missing enums in AVKitSPI.h.
Comment 8 Jeremy Jones 2015-06-19 14:51:16 PDT
Radar updated to:
rdar://problem/21467999
Comment 9 Darin Adler 2015-06-19 15:59:51 PDT
Comment on attachment 255227 [details]
Patch

While I am not an expert on this code, it looks good. r=me
Comment 10 WebKit Commit Bot 2015-06-22 10:42:46 PDT
Comment on attachment 255227 [details]
Patch

Clearing flags on attachment: 255227

Committed r185834: <http://trac.webkit.org/changeset/185834>
Comment 11 WebKit Commit Bot 2015-06-22 10:42:49 PDT
All reviewed patches have been landed.  Closing bug.