⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 185733 in webkit


Ignore:
Timestamp:
Jun 18, 2015, 8:46:06 PM (11 years ago)
Author:
commit-queue@webkit.org
Message:

Disable UIWindow for fullscreen video for selected clients.
https://bugs.webkit.org/show_bug.cgi?id=145852

Patch by Jeremy Jones <jeremyj@apple.com> on 2015-06-18
Reviewed by Simon Fraser.

Disable UIWindow for fullscreen video doesn't work everywhere (rdar://problem/21315993), so just disable it when creating a UIWindow won't work.
Fix some interface hiding and layout problems that showed up in the non UIWindow code path.

  • platform/RuntimeApplicationChecksIOS.h:
  • platform/RuntimeApplicationChecksIOS.mm: Remove iAD bundle identifier.
  • platform/ios/WebVideoFullscreenInterfaceAVKit.mm:

(WebVideoFullscreenInterfaceAVKit::setupFullscreen): Opt out of UIWindow when hosted in another process. And fix view parenting for non-window case.
(WebVideoFullscreenInterfaceAVKit::exitFullscreen): Fix for AVKit exit fullscreen complaining about -needsLayout.

(WebVideoFullscreenInterfaceAVKit::requestHideAndExitFullscreen):
(WebVideoFullscreenInterfaceAVKit::preparedToReturnToInline):
(WebVideoFullscreenInterfaceAVKit::willStartOptimizedFullscreen):
(WebVideoFullscreenInterfaceAVKit::didStartOptimizedFullscreen):
(WebVideoFullscreenInterfaceAVKit::willStopOptimizedFullscreen):
(WebVideoFullscreenInterfaceAVKit::didStopOptimizedFullscreen):
These hide and show the view controller where we hide and show the window.

Location:
trunk/Source/WebCore
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r185731 r185733  
     12015-06-18  Jeremy Jones  <jeremyj@apple.com>
     2
     3        Disable UIWindow for fullscreen video for selected clients.
     4        https://bugs.webkit.org/show_bug.cgi?id=145852
     5
     6        Reviewed by Simon Fraser.
     7
     8        Disable UIWindow for fullscreen video doesn't work everywhere (rdar://problem/21315993), so just disable it when creating a UIWindow won't work.
     9        Fix some interface hiding and layout problems that showed up in the non UIWindow code path.
     10
     11        * platform/RuntimeApplicationChecksIOS.h:
     12        * platform/RuntimeApplicationChecksIOS.mm: Remove iAD bundle identifier.
     13        * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
     14        (WebVideoFullscreenInterfaceAVKit::setupFullscreen): Opt out of UIWindow when hosted in another process. And fix view parenting for non-window case.
     15        (WebVideoFullscreenInterfaceAVKit::exitFullscreen): Fix for AVKit exit fullscreen complaining about -needsLayout.
     16
     17        (WebVideoFullscreenInterfaceAVKit::requestHideAndExitFullscreen):
     18        (WebVideoFullscreenInterfaceAVKit::preparedToReturnToInline):
     19        (WebVideoFullscreenInterfaceAVKit::willStartOptimizedFullscreen):
     20        (WebVideoFullscreenInterfaceAVKit::didStartOptimizedFullscreen):
     21        (WebVideoFullscreenInterfaceAVKit::willStopOptimizedFullscreen):
     22        (WebVideoFullscreenInterfaceAVKit::didStopOptimizedFullscreen):
     23        These hide and show the view controller where we hide and show the window.
     24
    1252015-06-18  Dean Jackson  <dino@apple.com>
    226
  • trunk/Source/WebCore/platform/RuntimeApplicationChecksIOS.h

    r172849 r185733  
    3030namespace WebCore {
    3131
    32 bool applicationIsAdSheet();
    3332WEBCORE_EXPORT bool applicationIsMobileMail();
    3433WEBCORE_EXPORT bool applicationIsMobileSafari();
  • trunk/Source/WebCore/platform/RuntimeApplicationChecksIOS.mm

    r184555 r185733  
    3131
    3232namespace WebCore {
    33 
    34 bool applicationIsAdSheet()
    35 {
    36     static const bool isAdSheet = [[[NSBundle mainBundle] bundleIdentifier] isEqualToString:@"com.apple.AdSheetPhone"];
    37     return isAdSheet;
    38 }
    3933
    4034bool applicationIsMobileMail()
  • trunk/Source/WebCore/platform/ios/WebVideoFullscreenInterfaceAVKit.mm

    r185727 r185733  
    877877}
    878878
     879@interface UIWindow ()
     880-(BOOL)_isHostedInAnotherProcess;
     881@end
     882
    879883void WebVideoFullscreenInterfaceAVKit::setupFullscreen(PlatformLayer& videoLayer, const WebCore::IntRect& initialRect, UIView* parentView, HTMLMediaElementEnums::VideoFullscreenMode mode, bool allowsPictureInPicturePlayback)
    880884{
     
    891895    m_parentWindow = parentView.window;
    892896
    893     if (!applicationIsAdSheet()) {
     897    if (![[parentView window] _isHostedInAnotherProcess]) {
    894898        m_window = adoptNS([allocUIWindowInstance() initWithFrame:[[getUIScreenClass() mainScreen] bounds]]);
    895899        [m_window setBackgroundColor:[getUIColorClass() clearColor]];
     
    927931        [m_viewController addChildViewController:m_playerViewController.get()];
    928932        [[m_viewController view] addSubview:[m_playerViewController view]];
    929         [m_playerViewController view].frame = [parentView convertRect:initialRect toView:nil];
    930     } else {
    931         [parentView addSubview:[m_playerViewController view]];
    932         [m_playerViewController view].frame = initialRect;
    933     }
     933    } else
     934        [parentView.window addSubview:[m_playerViewController view]];
     935
     936    [m_playerViewController view].frame = [parentView convertRect:initialRect toView:nil];
    934937
    935938    [[m_playerViewController view] setBackgroundColor:[getUIColorClass() clearColor]];
     
    10031006        [m_videoLayerContainer setVideoLayerGravity:AVVideoLayerGravityResizeAspect];
    10041007    [[m_playerViewController view] layoutIfNeeded];
    1005 
    10061008
    10071009    if (isMode(HTMLMediaElementEnums::VideoFullscreenModePictureInPicture)) {
     
    11061108
    11071109    [m_window setHidden:YES];
     1110    [[m_playerViewController view] setHidden:YES];
    11081111
    11091112    if (m_videoFullscreenModel && !m_exitRequested) {
     
    11181121    if (m_prepareToInlineCallback) {
    11191122       
    1120         if (m_viewController)
    1121             [m_playerViewController view].frame = [m_parentView convertRect:inlineRect toView:nil];
    1122         else
    1123             [m_playerViewController view].frame = inlineRect;
     1123        [m_playerViewController view].frame = [m_parentView convertRect:inlineRect toView:nil];
    11241124
    11251125        std::function<void(bool)> callback = WTF::move(m_prepareToInlineCallback);
     
    11541154        if (!visible) {
    11551155            [m_window setHidden:YES];
     1156            [[m_playerViewController view] setHidden:YES];
    11561157            return;
    11571158        }
     
    11641165            clearMode(HTMLMediaElementEnums::VideoFullscreenModeStandard);
    11651166            [m_window setHidden:YES];
     1167            [[m_playerViewController view] setHidden:YES];
    11661168        }];
    11671169    });
     
    11731175    [m_playerViewController setShowsPlaybackControls:YES];
    11741176    [m_window setHidden:YES];
     1177    [[m_playerViewController view] setHidden:YES];
    11751178
    11761179    if (m_fullscreenChangeObserver)
     
    11991202    LOG(Fullscreen, "WebVideoFullscreenInterfaceAVKit::willStopPictureInPicture(%p)", this);
    12001203    [m_window setHidden:NO];
     1204    [[m_playerViewController view] setHidden:NO];
    12011205
    12021206    if (m_videoFullscreenModel)
     
    12171221    clearMode(HTMLMediaElementEnums::VideoFullscreenModePictureInPicture);
    12181222    [m_window setHidden:YES];
     1223    [[m_playerViewController view] setHidden:YES];
    12191224   
    12201225    if (m_fullscreenChangeObserver)
Note: See TracChangeset for help on using the changeset viewer.