[Extra zoom mode] Require fullscreen for video playback
authoreric.carlson@apple.com <eric.carlson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 19 Mar 2018 21:22:15 +0000 (21:22 +0000)
committereric.carlson@apple.com <eric.carlson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 19 Mar 2018 21:22:15 +0000 (21:22 +0000)
commit186ca1c658d667596d5c886507d866367df19870
tree19d28627e190a2617ee1623b03bf1be6a93cc819
parent78738f03d2c64d2c268f72e4c83180cfd755f796
[Extra zoom mode] Require fullscreen for video playback
https://bugs.webkit.org/show_bug.cgi?id=183742
<rdar://problem/38235862>

Reviewed by Jer Noble.

Source/WebCore:

* Modules/modern-media-controls/media/playback-support.js:
(PlaybackSupport.prototype.syncControl): Always show the play button.
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::updatePlayState): Return immediately if playback requires fullscreen
(WebCore::HTMLMediaElement::didBecomeFullscreenElement): Call updatePlayState in case
playback is pending.
* html/HTMLMediaElement.h:
* platform/cocoa/VideoFullscreenModel.h:
(WebCore::VideoFullscreenModel::presentingViewController): New.
(WebCore::VideoFullscreenModel::createVideoFullscreenViewController): New.
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayerLayer):
(WebCore::MediaPlayerPrivateAVFoundationObjC::setVideoFullscreenMode):
* platform/ios/PlaybackSessionInterfaceAVKit.mm:
(WebCore::PlaybackSessionInterfaceAVKit::seekableRangesChanged):

* platform/ios/VideoFullscreenInterfaceAVKit.h:
* platform/ios/VideoFullscreenInterfaceAVKit.mm: Wrap AVPlayerLayerView so we can change its
behavior.
(WebAVPlayerLayerView_playerLayer):
(WebAVPlayerLayerView_videoView):
(allocWebAVPlayerLayerViewInstance):
(-[WebAVPlayerViewController initWithFullscreenInterface:]):
(-[WebAVPlayerViewController playerViewControllerShouldHandleDoneButtonTap:]):
(-[WebAVPlayerViewController enterFullScreenAnimated:completionHandler:]):
(-[WebAVPlayerViewController exitFullScreenAnimated:completionHandler:]):
(-[WebAVPlayerViewController NO_RETURN_DUE_TO_ASSERT]):
(-[WebAVPlayerViewController isPictureInPicturePossible]):
(-[WebAVPlayerViewController isPictureInPictureActive]):
(-[WebAVPlayerViewController isPictureInPictureSuspended]):
(-[WebAVPlayerViewController pictureInPictureActive]):
(-[WebAVPlayerViewController pictureInPictureWasStartedWhenEnteringBackground]):
(-[WebAVPlayerViewController view]):
(-[WebAVPlayerViewController showsPlaybackControls]):
(-[WebAVPlayerViewController setShowsPlaybackControls:]):
(-[WebAVPlayerViewController setAllowsPictureInPicturePlayback:]):
(-[WebAVPlayerViewController setDelegate:]):
(-[WebAVPlayerViewController setPlayerController:]):
(-[WebAVPlayerViewController avPlayerViewController]):
(-[WebAVPlayerViewController removeFromParentViewController]):
(VideoFullscreenInterfaceAVKit::setupFullscreen):
(fallbackViewController):
(VideoFullscreenInterfaceAVKit::presentingViewController):
(VideoFullscreenInterfaceAVKit::shouldExitFullscreenWithReason):
(VideoFullscreenInterfaceAVKit::doSetup):
(WebCore::supportsPictureInPicture):

Source/WebCore/PAL:

* pal/spi/cocoa/AVKitSPI.h:

Source/WebKit:

* UIProcess/Cocoa/VideoFullscreenManagerProxy.h:
* UIProcess/Cocoa/VideoFullscreenManagerProxy.mm:
(-[WKVideoFullScreenViewController initWithAVPlayerViewController:]):
(-[WKVideoFullScreenViewController viewDidLoad]):
(-[WKVideoFullScreenViewController prefersStatusBarHidden]):
(WebKit::VideoFullscreenModelContext::presentingViewController):
(WebKit::VideoFullscreenModelContext::createVideoFullscreenViewController):
* WebProcess/cocoa/VideoFullscreenManager.mm:
(WebKit::VideoFullscreenManager::didEnterFullscreen):

Source/WTF:

* wtf/Platform.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@229714 268f45cc-cd09-0410-ab3c-d52691b4dbfc
18 files changed:
Source/WTF/ChangeLog
Source/WTF/wtf/Platform.h
Source/WebCore/ChangeLog
Source/WebCore/Modules/modern-media-controls/media/playback-support.js
Source/WebCore/PAL/ChangeLog
Source/WebCore/PAL/pal/spi/cocoa/AVKitSPI.h
Source/WebCore/html/HTMLMediaElement.cpp
Source/WebCore/html/HTMLMediaElement.h
Source/WebCore/platform/cocoa/VideoFullscreenModel.h
Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm
Source/WebCore/platform/ios/PlaybackSessionInterfaceAVKit.mm
Source/WebCore/platform/ios/VideoFullscreenInterfaceAVKit.h
Source/WebCore/platform/ios/VideoFullscreenInterfaceAVKit.mm
Source/WebCore/platform/ios/WebVideoFullscreenControllerAVKit.mm
Source/WebKit/ChangeLog
Source/WebKit/UIProcess/Cocoa/VideoFullscreenManagerProxy.h
Source/WebKit/UIProcess/Cocoa/VideoFullscreenManagerProxy.mm
Source/WebKit/WebProcess/cocoa/VideoFullscreenManager.mm