Add AVKit fullscreen video interface.

https://bugs.webkit.org/show_bug.cgi?id=126818

Patch by Jeremy Jones <jeremyj@apple.com> on 2014-01-20
Reviewed by Eric Carlson.

Source/WebCore:

No new tests, no observable change in functionality.

* WebCore.exp.in:
* WebCore.xcodeproj/project.pbxproj:
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::parseAttribute):
* html/HTMLMediaElement.h:
Add ability for fullscreen to borrow the AVPlayerLayer.
* page/Settings.cpp:
* page/Settings.h:
(WebCore::Settings::setMediaPlaybackFullscreenAVKit):
(WebCore::Settings::mediaPlaybackFullscreenAVKit):
Add a disabled setting.
* platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
(WebCore::MediaPlayerPrivateAVFoundation::supportsFullscreen):
Enabled fullscreen for iOS.
* platform/ios/WebVideoFullscreenControllerAVKit.h: Added.
* platform/ios/WebVideoFullscreenControllerAVKit.mm: Added.
(-[WebAVPlayerController init]):
(-[WebAVPlayerController dealloc]):
(-[WebAVPlayerController forwardingTargetForSelector:]):
(-[WebAVPlayerController shouldDismissForDone]):
(-[WebAVPlayerController play:]):
(-[WebAVPlayerController pause:]):
(-[WebAVPlayerController togglePlayback:]):
(-[WebAVPlayerController isPlaying]):
(-[WebAVPlayerController setPlaying:]):
(+[WebAVPlayerController keyPathsForValuesAffectingPlaying]):
(-[WebAVPlayerController seekToTime:]):
(-[WebAVPlayerController updateTimingWithCurrentTime:]):
(-[WebAVPlayerController effectiveRate]):
(-[WebAVPlayerController setMediaElement:]):
(-[WebAVPlayerController handleEvent:]):
(-[WebVideoFullscreenController init]):
(-[WebVideoFullscreenController dealloc]):
(-[WebVideoFullscreenController setMediaElement:]):
(-[WebVideoFullscreenController mediaElement]):
(-[WebVideoFullscreenController enterFullscreen:]):
(-[WebVideoFullscreenController exitFullscreen]):
Add WebAVPlayerController for HTMLMediaElememt to interface with AVPlayerViewController.

Source/WebKit/mac:

* WebCoreSupport/WebChromeClient.h:
* WebCoreSupport/WebChromeClient.mm:
(WebChromeClient::supportsFullscreenForNode):
Enable *FullscreenForNode for HTMLMediaElement for iOS

* WebView/WebPreferenceKeysPrivate.h:
* WebView/WebPreferences.mm:
(+[WebPreferences initialize]):
(-[WebPreferences mediaPlaybackFullscreenAVKit]):
(-[WebPreferences setMediaPlaybackFullscreenAVKit:]):
* WebView/WebPreferencesPrivate.h:
* WebView/WebView.mm:
(-[WebView _preferencesChanged:]):
(-[WebView _enterFullscreenForNode:WebCore::]):
* WebView/WebViewInternal.h:
Add a disabled pref mediaPlaybackFullscreenAVKit.
Use WebVideoFullscreenControllerAVKit on iOS

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@162379 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 63e67ef5
2014-01-20 Jeremy Jones <jeremyj@apple.com>
Add AVKit fullscreen video interface.
https://bugs.webkit.org/show_bug.cgi?id=126818
Reviewed by Eric Carlson.
No new tests, no observable change in functionality.
* WebCore.exp.in:
* WebCore.xcodeproj/project.pbxproj:
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::parseAttribute):
* html/HTMLMediaElement.h:
Add ability for fullscreen to borrow the AVPlayerLayer.
* page/Settings.cpp:
* page/Settings.h:
(WebCore::Settings::setMediaPlaybackFullscreenAVKit):
(WebCore::Settings::mediaPlaybackFullscreenAVKit):
Add a disabled setting.
* platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
(WebCore::MediaPlayerPrivateAVFoundation::supportsFullscreen):
Enabled fullscreen for iOS.
* platform/ios/WebVideoFullscreenControllerAVKit.h: Added.
* platform/ios/WebVideoFullscreenControllerAVKit.mm: Added.
(-[WebAVPlayerController init]):
(-[WebAVPlayerController dealloc]):
(-[WebAVPlayerController forwardingTargetForSelector:]):
(-[WebAVPlayerController shouldDismissForDone]):
(-[WebAVPlayerController play:]):
(-[WebAVPlayerController pause:]):
(-[WebAVPlayerController togglePlayback:]):
(-[WebAVPlayerController isPlaying]):
(-[WebAVPlayerController setPlaying:]):
(+[WebAVPlayerController keyPathsForValuesAffectingPlaying]):
(-[WebAVPlayerController seekToTime:]):
(-[WebAVPlayerController updateTimingWithCurrentTime:]):
(-[WebAVPlayerController effectiveRate]):
(-[WebAVPlayerController setMediaElement:]):
(-[WebAVPlayerController handleEvent:]):
(-[WebVideoFullscreenController init]):
(-[WebVideoFullscreenController dealloc]):
(-[WebVideoFullscreenController setMediaElement:]):
(-[WebVideoFullscreenController mediaElement]):
(-[WebVideoFullscreenController enterFullscreen:]):
(-[WebVideoFullscreenController exitFullscreen]):
Add WebAVPlayerController for HTMLMediaElememt to interface with AVPlayerViewController.
2014-01-20 Zan Dobersek <zdobersek@igalia.com>
Replace uses of std::forward<T>(), std::unique_ptr<T>::clear() that landed in r162368
......@@ -2463,6 +2463,7 @@ __ZN7WebCore8Document19dispatchWindowEventEN3WTF10PassRefPtrINS_5EventEEENS2_INS
__ZN7WebCore8IntPointC1ERK7CGPoint
__ZN7WebCore8PositionC1EN3WTF10PassRefPtrINS_4NodeEEENS0_19LegacyEditingOffsetE
__ZN7WebCore8SVGNames4initEv
__ZN7WebCore8Settings13gAVKitEnabledE
__ZN7WebCore8Settings13setStandaloneEb
__ZN7WebCore8Settings23setNetworkInterfaceNameERKN3WTF6StringE
__ZN7WebCore8Settings31setAudioSessionCategoryOverrideEj
......@@ -3052,7 +3053,7 @@ __ZN7WebCore4toJSEPN3JSC9ExecStateEPNS_17JSDOMGlobalObjectEPNS_10TimeRangesE
__ZNK7WebCore10TimeRanges7nearestEd
#endif
#if ENABLE(VIDEO) && !PLATFORM(IOS)
#if ENABLE(VIDEO)
__ZNK7WebCore16HTMLMediaElement5endedEv
__ZNK7WebCore16HTMLMediaElement6pausedEv
.objc_class_name_WebVideoFullscreenController
......
......@@ -1301,6 +1301,8 @@
3F2B33ED165AF15600E3987C /* DOMWebKitCSSViewportRuleInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 3F2B33E8165AF15500E3987C /* DOMWebKitCSSViewportRuleInternal.h */; };
3F2B33EE165AF15600E3987C /* JSWebKitCSSViewportRule.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3F2B33E9165AF15500E3987C /* JSWebKitCSSViewportRule.cpp */; };
3F2B33EF165AF15600E3987C /* JSWebKitCSSViewportRule.h in Headers */ = {isa = PBXBuildFile; fileRef = 3F2B33EA165AF15500E3987C /* JSWebKitCSSViewportRule.h */; };
3F42B31D1881191B00278AAC /* WebVideoFullscreenControllerAVKit.h in Headers */ = {isa = PBXBuildFile; fileRef = 3F42B31B1881191B00278AAC /* WebVideoFullscreenControllerAVKit.h */; settings = {ATTRIBUTES = (Private, ); }; };
3F42B31E1881191B00278AAC /* WebVideoFullscreenControllerAVKit.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3F42B31C1881191B00278AAC /* WebVideoFullscreenControllerAVKit.mm */; };
3FFFF9A8159D9A550020BBD5 /* WebKitCSSViewportRule.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3FFFF9A6159D9A550020BBD5 /* WebKitCSSViewportRule.cpp */; };
3FFFF9A9159D9A550020BBD5 /* WebKitCSSViewportRule.h in Headers */ = {isa = PBXBuildFile; fileRef = 3FFFF9A7159D9A550020BBD5 /* WebKitCSSViewportRule.h */; };
3FFFF9AD159D9B060020BBD5 /* ViewportStyleResolver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3FFFF9AB159D9B060020BBD5 /* ViewportStyleResolver.cpp */; };
......@@ -8184,6 +8186,8 @@
3F2B33E8165AF15500E3987C /* DOMWebKitCSSViewportRuleInternal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DOMWebKitCSSViewportRuleInternal.h; sourceTree = "<group>"; };
3F2B33E9165AF15500E3987C /* JSWebKitCSSViewportRule.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSWebKitCSSViewportRule.cpp; sourceTree = "<group>"; };
3F2B33EA165AF15500E3987C /* JSWebKitCSSViewportRule.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSWebKitCSSViewportRule.h; sourceTree = "<group>"; };
3F42B31B1881191B00278AAC /* WebVideoFullscreenControllerAVKit.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = WebVideoFullscreenControllerAVKit.h; path = ios/WebVideoFullscreenControllerAVKit.h; sourceTree = "<group>"; };
3F42B31C1881191B00278AAC /* WebVideoFullscreenControllerAVKit.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = WebVideoFullscreenControllerAVKit.mm; path = ios/WebVideoFullscreenControllerAVKit.mm; sourceTree = "<group>"; };
3FFFF9A6159D9A550020BBD5 /* WebKitCSSViewportRule.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebKitCSSViewportRule.cpp; sourceTree = "<group>"; };
3FFFF9A7159D9A550020BBD5 /* WebKitCSSViewportRule.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebKitCSSViewportRule.h; sourceTree = "<group>"; };
3FFFF9AB159D9B060020BBD5 /* ViewportStyleResolver.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ViewportStyleResolver.cpp; sourceTree = "<group>"; };
......@@ -18075,6 +18079,8 @@
FE0D84EA1048436E001A179E /* WebEvent.mm */,
A502C5DD13049B3500FC7D53 /* WebSafeGCActivityCallbackIOS.h */,
C2C4CB1D161A131200D214DA /* WebSafeIncrementalSweeperIOS.h */,
3F42B31B1881191B00278AAC /* WebVideoFullscreenControllerAVKit.h */,
3F42B31C1881191B00278AAC /* WebVideoFullscreenControllerAVKit.mm */,
E453903C0EAFD637003695C8 /* WidgetIOS.mm */,
);
name = ios;
......@@ -25040,6 +25046,7 @@
A9C6E4F40D745E48006442E9 /* PluginData.h in Headers */,
97205ABC1239292700B17380 /* PluginDocument.h in Headers */,
1ADA14110E1AE5D900023EE5 /* PluginMainThreadScheduler.h in Headers */,
3F42B31D1881191B00278AAC /* WebVideoFullscreenControllerAVKit.h in Headers */,
71E2183A17359FB8006E6E4D /* PlugInsResources.h in Headers */,
1AA8799011CBE846003C664F /* PluginStrategy.h in Headers */,
0AFDAC3D10F5448C00E1F3D2 /* PluginViewBase.h in Headers */,
......@@ -29027,6 +29034,7 @@
B2227A900D00BF220071B782 /* SVGPolygonElement.cpp in Sources */,
B2227A930D00BF220071B782 /* SVGPolylineElement.cpp in Sources */,
B543B85717EB758F003BE93A /* SVGPropertyInfo.cpp in Sources */,
3F42B31E1881191B00278AAC /* WebVideoFullscreenControllerAVKit.mm in Sources */,
B2227A960D00BF220071B782 /* SVGPreserveAspectRatio.cpp in Sources */,
B2227A990D00BF220071B782 /* SVGRadialGradientElement.cpp in Sources */,
B2227A9D0D00BF220071B782 /* SVGRectElement.cpp in Sources */,
......@@ -4846,11 +4846,12 @@ void HTMLMediaElement::enterFullscreen()
if (hasMediaControls())
mediaControls()->enteredFullscreen();
if (document().page()) {
#if !PLATFORM(IOS)
document().page()->chrome().client().enterFullscreenForNode(this);
scheduleEvent(eventNames().webkitbeginfullscreenEvent);
#else
if (m_player)
if (document().page()->chrome().client().supportsFullscreenForNode(this)) {
document().page()->chrome().client().enterFullscreenForNode(this);
scheduleEvent(eventNames().webkitbeginfullscreenEvent);
}
#if PLATFORM(IOS)
else if (m_player)
m_player->enterFullscreen();
#endif
}
......@@ -4874,11 +4875,13 @@ void HTMLMediaElement::exitFullscreen()
if (document().page()) {
if (document().page()->chrome().requiresFullscreenForVideoPlayback())
pauseInternal();
#if !PLATFORM(IOS)
document().page()->chrome().client().exitFullscreenForNode(this);
scheduleEvent(eventNames().webkitendfullscreenEvent);
#else
if (m_player)
if (document().page()->chrome().client().supportsFullscreenForNode(this)) {
document().page()->chrome().client().exitFullscreenForNode(this);
scheduleEvent(eventNames().webkitendfullscreenEvent);
}
#if PLATFORM(IOS)
else if (m_player)
m_player->exitFullscreen();
#endif
}
......@@ -4904,8 +4907,31 @@ PlatformMedia HTMLMediaElement::platformMedia() const
#if USE(ACCELERATED_COMPOSITING)
PlatformLayer* HTMLMediaElement::platformLayer() const
{
return m_player ? m_player->platformLayer() : 0;
#if PLATFORM(IOS)
if (m_platformLayerBorrowed)
return nullptr;
#endif
return m_player ? m_player->platformLayer() : nullptr;
}
#if PLATFORM(IOS)
PlatformLayer* HTMLMediaElement::borrowPlatformLayer()
{
ASSERT(!m_platformLayerBorrowed);
m_platformLayerBorrowed = true;
if (renderer())
renderer()->updateFromElement();
return m_player ? m_player->platformLayer() : nullptr;
}
void HTMLMediaElement::returnPlatformLayer(PlatformLayer* platformLayer)
{
ASSERT(m_platformLayerBorrowed && platformLayer == (m_player ? m_player->platformLayer() : nullptr));
m_platformLayerBorrowed = false;
if (renderer())
renderer()->updateFromElement();
}
#endif
#endif
bool HTMLMediaElement::hasClosedCaptions() const
......
......@@ -132,6 +132,10 @@ public:
PlatformMedia platformMedia() const;
#if USE(ACCELERATED_COMPOSITING)
PlatformLayer* platformLayer() const;
#if PLATFORM(IOS)
PlatformLayer* borrowPlatformLayer();
void returnPlatformLayer(PlatformLayer*);
#endif
#endif
enum DelayedActionType {
......@@ -777,6 +781,7 @@ private:
#if PLATFORM(IOS)
bool m_requestingPlay : 1;
bool m_platformLayerBorrowed : 1;
#endif
bool m_resumePlaybackAfterInterruption : 1;
......
......@@ -98,6 +98,7 @@ bool Settings::gLowPowerVideoAudioBufferSizeEnabled = false;
#if PLATFORM(IOS)
bool Settings::gNetworkDataUsageTrackingEnabled = false;
bool Settings::gAVKitEnabled = false;
#endif
// NOTEs
......
......@@ -307,6 +307,9 @@ public:
static void setNetworkInterfaceName(const String&);
static const String& networkInterfaceName();
static void setAVKitEnabled(bool flag) { gAVKitEnabled = flag; }
static bool avKitEnabled() { return gAVKitEnabled; }
#endif
private:
......@@ -405,6 +408,7 @@ private:
static bool gShouldRespectPriorityInCSSAttributeSetters;
#if PLATFORM(IOS)
static bool gNetworkDataUsageTrackingEnabled;
static bool gAVKitEnabled;
#endif
static double gHiddenPageDOMTimerAlignmentInterval;
......
......@@ -38,6 +38,7 @@
#include "URL.h"
#include "Logging.h"
#include "PlatformLayer.h"
#include "Settings.h"
#include "SoftLinking.h"
#include "TimeRanges.h"
#include <CoreMedia/CoreMedia.h>
......@@ -474,6 +475,10 @@ bool MediaPlayerPrivateAVFoundation::supportsFullscreen() const
return true;
#else
// FIXME: WebVideoFullscreenController assumes a QTKit/QuickTime media engine
#if PLATFORM(IOS)
if (Settings::avKitEnabled())
return true;
#endif
return false;
#endif
}
......
/*
* Copyright (C) 2013 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef WebVideoFullscreenControllerAVKit_h
#define WebVideoFullscreenControllerAVKit_h
#if PLATFORM(IOS)
#import <wtf/RefPtr.h>
@class UIScreen;
namespace WebCore {
class HTMLMediaElement;
}
@interface WebVideoFullscreenController : NSObject
- (void)setMediaElement:(WebCore::HTMLMediaElement*)mediaElement;
- (WebCore::HTMLMediaElement*)mediaElement;
- (void)enterFullscreen:(UIScreen *)screen;
- (void)exitFullscreen;
@end
#endif
#endif // WebVideoFullscreenControllerAVKit_h
2014-01-20 Jeremy Jones <jeremyj@apple.com>
Add AVKit fullscreen video interface.
https://bugs.webkit.org/show_bug.cgi?id=126818
Reviewed by Eric Carlson.
* WebCoreSupport/WebChromeClient.h:
* WebCoreSupport/WebChromeClient.mm:
(WebChromeClient::supportsFullscreenForNode):
Enable *FullscreenForNode for HTMLMediaElement for iOS
* WebView/WebPreferenceKeysPrivate.h:
* WebView/WebPreferences.mm:
(+[WebPreferences initialize]):
(-[WebPreferences mediaPlaybackFullscreenAVKit]):
(-[WebPreferences setMediaPlaybackFullscreenAVKit:]):
* WebView/WebPreferencesPrivate.h:
* WebView/WebView.mm:
(-[WebView _preferencesChanged:]):
(-[WebView _enterFullscreenForNode:WebCore::]):
* WebView/WebViewInternal.h:
Add a disabled pref mediaPlaybackFullscreenAVKit.
Use WebVideoFullscreenControllerAVKit on iOS
2014-01-18 Brian Burg <bburg@apple.com>
Web Inspector: Page should use std::unique_ptr for InspectorController
......
......@@ -185,7 +185,7 @@ public:
}
#endif
#if ENABLE(VIDEO) && !PLATFORM(IOS)
#if ENABLE(VIDEO)
virtual bool supportsFullscreenForNode(const WebCore::Node*) override;
virtual void enterFullscreenForNode(WebCore::Node*) override;
virtual void exitFullscreenForNode(WebCore::Node*) override;
......
......@@ -967,10 +967,14 @@ void WebChromeClient::scheduleCompositingLayerFlush()
#endif
#if ENABLE(VIDEO) && !PLATFORM(IOS)
#if ENABLE(VIDEO)
bool WebChromeClient::supportsFullscreenForNode(const Node* node)
{
#if PLATFORM(IOS)
if (!Settings::avKitEnabled())
return false;
#endif
return isHTMLVideoElement(node);
}
......
......@@ -133,6 +133,7 @@
#if TARGET_OS_IPHONE
#define WebKitMediaPlaybackAllowsAirPlayPreferenceKey @"WebKitMediaPlaybackAllowsAirPlay"
#define WebKitAudioSessionCategoryOverride @"WebKitAudioSessionCategoryOverride"
#define WebKitAVKitEnabled @"WebKitAVKitEnabled"
#endif
#define WebKitRegionBasedColumnsEnabledKey @"WebKitRegionBasedColumnsEnabled"
#define WebKitShouldRespectImageOrientationKey @"WebKitShouldRespectImageOrientation"
......
......@@ -531,6 +531,7 @@ public:
[NSNumber numberWithBool:NO], WebKitMediaPlaybackAllowsInlinePreferenceKey,
[NSNumber numberWithBool:YES], WebKitMediaPlaybackAllowsAirPlayPreferenceKey,
[NSNumber numberWithUnsignedInt:AudioSession::None], WebKitAudioSessionCategoryOverride,
[NSNumber numberWithBool:NO], WebKitAVKitEnabled,
[NSNumber numberWithLongLong:WebCore::ApplicationCacheStorage::noQuota()], WebKitApplicationCacheTotalQuota,
// Per-Origin Quota on iOS is 25MB. When the quota is reached for a particular origin
......@@ -2218,6 +2219,16 @@ static NSString *classIBCreatorID = nil;
[self _setUnsignedIntValue:override forKey:WebKitAudioSessionCategoryOverride];
}
- (BOOL)avKitEnabled
{
return [self _boolValueForKey:WebKitAVKitEnabled];
}
- (void)setAVKitEnabled:(bool)flag
{
[self _setBoolValue:flag forKey:WebKitAVKitEnabled];
}
- (BOOL)networkDataUsageTrackingEnabled
{
return [self _boolValueForKey:WebKitNetworkDataUsageTrackingEnabledPreferenceKey];
......
......@@ -259,6 +259,9 @@ extern NSString *WebPreferencesCacheModelChangedInternalNotification;
- (unsigned)audioSessionCategoryOverride;
- (void)setAudioSessionCategoryOverride:(unsigned)override;
- (BOOL)avKitEnabled;
- (void)setAVKitEnabled:(bool)flag;
// WARNING: this affect network performance. This must not be enabled for production use.
// Enabling this makes WebCore reports the network data usage.
// This is a global setting.
......
......@@ -242,6 +242,7 @@
#import <WebCore/WebCoreThreadMessage.h>
#import <WebCore/WebCoreThreadRun.h>
#import <WebCore/WebEvent.h>
#import <WebCore/WebVideoFullscreenControllerAVKit.h>
#import <dispatch/private.h>
#import <wtf/FastMalloc.h>
......@@ -2354,6 +2355,7 @@ static bool needsSelfRetainWhileLoadingQuirk()
settings.setAudioSessionCategoryOverride([preferences audioSessionCategoryOverride]);
settings.setNetworkDataUsageTrackingEnabled([preferences networkDataUsageTrackingEnabled]);
settings.setNetworkInterfaceName([preferences networkInterfaceName]);
settings.setAVKitEnabled([preferences avKitEnabled]);
#endif
settings.setMediaPlaybackRequiresUserGesture([preferences mediaPlaybackRequiresUserGesture]);
settings.setMediaPlaybackAllowsInline([preferences mediaPlaybackAllowsInline]);
......@@ -8467,7 +8469,7 @@ bool LayerFlushController::flushLayers()
#endif
#if ENABLE(VIDEO) && !PLATFORM(IOS)
#if ENABLE(VIDEO)
- (void)_enterFullscreenForNode:(WebCore::Node*)node
{
ASSERT(isHTMLVideoElement(node));
......@@ -8490,7 +8492,11 @@ bool LayerFlushController::flushLayers()
if (!_private->fullscreenController) {
_private->fullscreenController = [[WebVideoFullscreenController alloc] init];
[_private->fullscreenController setMediaElement:videoElement];
[_private->fullscreenController enterFullscreen:[[self window] screen]];
#if PLATFORM(IOS)
[_private->fullscreenController enterFullscreen:nil];
#else
[_private->fullscreenController enterFullscreen:[[self window] screen]];
#endif
}
else
[_private->fullscreenController setMediaElement:videoElement];
......
......@@ -236,7 +236,7 @@ OBJC_CLASS NSTextAlternatives;
- (void)_preferencesChanged:(WebPreferences *)preferences;
#if ENABLE(VIDEO) && !PLATFORM(IOS) && defined(__cplusplus)
#if ENABLE(VIDEO) && defined(__cplusplus)
- (void)_enterFullscreenForNode:(WebCore::Node*)node;
- (void)_exitFullscreen;
#endif
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment