Make it possible to enable VIDEO_PRESENTATION_MODE on other Cocoa platforms.
authoradachan@apple.com <adachan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 21 Jan 2016 18:25:02 +0000 (18:25 +0000)
committeradachan@apple.com <adachan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 21 Jan 2016 18:25:02 +0000 (18:25 +0000)
https://bugs.webkit.org/show_bug.cgi?id=153218

Reviewed by Eric Carlson.

Source/JavaScriptCore:

* Configurations/FeatureDefines.xcconfig:

Source/WebCore:

No new tests. Code refactoring.

* Configurations/FeatureDefines.xcconfig:
* WebCore.xcodeproj/project.pbxproj:
Move WebVideoFullscreenInterface.h from ios to cocoa.
* html/HTMLVideoElement.cpp:
(WebCore::HTMLVideoElement::webkitSupportsPresentationMode):
The declaration of supportsPictureInPicture() has been moved to WebVideoFullscreenInterface.h
so include that header instead. Guard the supportsPictureInPicture() call with PLATFORM(COCOA)
as that method is only defined in Cocoa.
* platform/cocoa/WebVideoFullscreenInterface.h: Renamed from Source/WebCore/platform/ios/WebVideoFullscreenInterface.h.
Also move the declaration of supportsPictureInPicture() here.
* platform/graphics/MediaPlayer.cpp:
* platform/graphics/MediaPlayer.h:
* platform/graphics/MediaPlayerPrivate.h:
Implementations of methods related to the video fullscreen layer are now guarded by
PLATFORM(IOS) || (PLATFORM(MAC) && ENABLE(VIDEO_PRESENTATION_MODE)) instead.
* platform/ios/WebVideoFullscreenInterfaceAVKit.h:
Declaration of supportsPictureInPicture() has been moved to WebVideoFullscreenInterface.h
* platform/mac/WebVideoFullscreenInterfaceMac.mm: Added.
(WebCore::supportsPictureInPicture):
Return false for now.

Source/WebKit/mac:

* Configurations/FeatureDefines.xcconfig:

Source/WebKit2:

* Configurations/FeatureDefines.xcconfig:

Source/WTF:

* wtf/Platform.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@195412 268f45cc-cd09-0410-ab3c-d52691b4dbfc

18 files changed:
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/Configurations/FeatureDefines.xcconfig
Source/WTF/ChangeLog
Source/WTF/wtf/Platform.h
Source/WebCore/ChangeLog
Source/WebCore/Configurations/FeatureDefines.xcconfig
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/html/HTMLVideoElement.cpp
Source/WebCore/platform/cocoa/WebVideoFullscreenInterface.h [moved from Source/WebCore/platform/ios/WebVideoFullscreenInterface.h with 91% similarity]
Source/WebCore/platform/graphics/MediaPlayer.cpp
Source/WebCore/platform/graphics/MediaPlayer.h
Source/WebCore/platform/graphics/MediaPlayerPrivate.h
Source/WebCore/platform/ios/WebVideoFullscreenInterfaceAVKit.h
Source/WebCore/platform/mac/WebVideoFullscreenInterfaceMac.mm [new file with mode: 0644]
Source/WebKit/mac/ChangeLog
Source/WebKit/mac/Configurations/FeatureDefines.xcconfig
Source/WebKit2/ChangeLog
Source/WebKit2/Configurations/FeatureDefines.xcconfig

index bf41ce2..93e554c 100644 (file)
@@ -1,3 +1,12 @@
+2016-01-19  Ada Chan  <adachan@apple.com>
+
+        Make it possible to enable VIDEO_PRESENTATION_MODE on other Cocoa platforms.
+        https://bugs.webkit.org/show_bug.cgi?id=153218
+
+        Reviewed by Eric Carlson.
+
+        * Configurations/FeatureDefines.xcconfig:
+
 2016-01-21  Per Arne Vollan  <peavo@outlook.com>
 
         [B3][CMake] Add missing source file.
index 57bcdd4..f3ca632 100644 (file)
@@ -170,6 +170,10 @@ ENABLE_TOUCH_ICON_LOADING = ;
 ENABLE_USERSELECT_ALL = ENABLE_USERSELECT_ALL;
 ENABLE_VIDEO = ENABLE_VIDEO;
 ENABLE_VIDEO_PRESENTATION_MODE[sdk=iphone*] = ENABLE_VIDEO_PRESENTATION_MODE;
+ENABLE_VIDEO_PRESENTATION_MODE[sdk=macosx*] = $(ENABLE_VIDEO_PRESENTATION_MODE_macosx_$(TARGET_MAC_OS_X_VERSION_MAJOR))
+ENABLE_VIDEO_PRESENTATION_MODE_macosx_101000 = ;
+ENABLE_VIDEO_PRESENTATION_MODE_macosx_101100 = ;
+ENABLE_VIDEO_PRESENTATION_MODE_macosx_101200 = ENABLE_VIDEO_PRESENTATION_MODE;
 ENABLE_VIDEO_TRACK = ENABLE_VIDEO_TRACK;
 ENABLE_DATACUE_VALUE = ENABLE_DATACUE_VALUE;
 ENABLE_VIEW_MODE_CSS_MEDIA = ;
index ee7b151..e12982a 100644 (file)
@@ -1,3 +1,12 @@
+2016-01-19  Ada Chan  <adachan@apple.com>
+
+        Make it possible to enable VIDEO_PRESENTATION_MODE on other Cocoa platforms.
+        https://bugs.webkit.org/show_bug.cgi?id=153218
+
+        Reviewed by Eric Carlson.
+
+        * wtf/Platform.h:
+
 2016-01-19  Filip Pizlo  <fpizlo@apple.com>
 
         B3 should have basic path specialization
index 31e6935..18bf960 100644 (file)
 #define USE_MEDIATOOLBOX 1
 #endif
 
-#if PLATFORM(IOS)
+#if PLATFORM(IOS) || (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101200)
 #define ENABLE_VIDEO_PRESENTATION_MODE 1
 #endif
 
index c22c770..5489d7e 100644 (file)
@@ -1,3 +1,33 @@
+2016-01-19  Ada Chan  <adachan@apple.com>
+
+        Make it possible to enable VIDEO_PRESENTATION_MODE on other Cocoa platforms.
+        https://bugs.webkit.org/show_bug.cgi?id=153218
+
+        Reviewed by Eric Carlson.
+
+        No new tests. Code refactoring.
+
+        * Configurations/FeatureDefines.xcconfig:
+        * WebCore.xcodeproj/project.pbxproj:
+        Move WebVideoFullscreenInterface.h from ios to cocoa.
+        * html/HTMLVideoElement.cpp:
+        (WebCore::HTMLVideoElement::webkitSupportsPresentationMode):
+        The declaration of supportsPictureInPicture() has been moved to WebVideoFullscreenInterface.h
+        so include that header instead. Guard the supportsPictureInPicture() call with PLATFORM(COCOA)
+        as that method is only defined in Cocoa.
+        * platform/cocoa/WebVideoFullscreenInterface.h: Renamed from Source/WebCore/platform/ios/WebVideoFullscreenInterface.h.
+        Also move the declaration of supportsPictureInPicture() here.
+        * platform/graphics/MediaPlayer.cpp:
+        * platform/graphics/MediaPlayer.h:
+        * platform/graphics/MediaPlayerPrivate.h:
+        Implementations of methods related to the video fullscreen layer are now guarded by
+        PLATFORM(IOS) || (PLATFORM(MAC) && ENABLE(VIDEO_PRESENTATION_MODE)) instead.
+        * platform/ios/WebVideoFullscreenInterfaceAVKit.h:
+        Declaration of supportsPictureInPicture() has been moved to WebVideoFullscreenInterface.h
+        * platform/mac/WebVideoFullscreenInterfaceMac.mm: Added.
+        (WebCore::supportsPictureInPicture):
+        Return false for now.
+
 2016-01-21  Said Abou-Hallawa  <sabouhallawa@apple.com>
 
         A crash reproducible in Path::isEmpty() under RenderSVGShape::paint()
index 57bcdd4..f3ca632 100644 (file)
@@ -170,6 +170,10 @@ ENABLE_TOUCH_ICON_LOADING = ;
 ENABLE_USERSELECT_ALL = ENABLE_USERSELECT_ALL;
 ENABLE_VIDEO = ENABLE_VIDEO;
 ENABLE_VIDEO_PRESENTATION_MODE[sdk=iphone*] = ENABLE_VIDEO_PRESENTATION_MODE;
+ENABLE_VIDEO_PRESENTATION_MODE[sdk=macosx*] = $(ENABLE_VIDEO_PRESENTATION_MODE_macosx_$(TARGET_MAC_OS_X_VERSION_MAJOR))
+ENABLE_VIDEO_PRESENTATION_MODE_macosx_101000 = ;
+ENABLE_VIDEO_PRESENTATION_MODE_macosx_101100 = ;
+ENABLE_VIDEO_PRESENTATION_MODE_macosx_101200 = ENABLE_VIDEO_PRESENTATION_MODE;
 ENABLE_VIDEO_TRACK = ENABLE_VIDEO_TRACK;
 ENABLE_DATACUE_VALUE = ENABLE_DATACUE_VALUE;
 ENABLE_VIEW_MODE_CSS_MEDIA = ;
index 8cbfe82..cb2a7fe 100644 (file)
                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 */; };
                3FBC4AEA189880EF0046EE38 /* WebVideoFullscreenModel.h in Headers */ = {isa = PBXBuildFile; fileRef = 3FBC4AE9189880EF0046EE38 /* WebVideoFullscreenModel.h */; settings = {ATTRIBUTES = (Private, ); }; };
-               3FBC4AEC1898810E0046EE38 /* WebVideoFullscreenInterface.h in Headers */ = {isa = PBXBuildFile; fileRef = 3FBC4AEB1898810E0046EE38 /* WebVideoFullscreenInterface.h */; settings = {ATTRIBUTES = (Private, ); }; };
                3FBC4AF3189881560046EE38 /* WebVideoFullscreenInterfaceAVKit.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3FBC4AF1189881560046EE38 /* WebVideoFullscreenInterfaceAVKit.mm */; };
                3FBC4AF4189881560046EE38 /* WebVideoFullscreenInterfaceAVKit.h in Headers */ = {isa = PBXBuildFile; fileRef = 3FBC4AF2189881560046EE38 /* WebVideoFullscreenInterfaceAVKit.h */; settings = {ATTRIBUTES = (Private, ); }; };
                3FFFF9A8159D9A550020BBD5 /* WebKitCSSViewportRule.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3FFFF9A6159D9A550020BBD5 /* WebKitCSSViewportRule.cpp */; };
                51FB5505113E3E9100821176 /* JSCloseEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51FB5503113E3E9100821176 /* JSCloseEvent.cpp */; };
                51FB67DB1AE6B82B00D06C5A /* ContentExtensionStyleSheet.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51FB67D91AE6B5E400D06C5A /* ContentExtensionStyleSheet.cpp */; };
                51FB67DC1AE6B82F00D06C5A /* ContentExtensionStyleSheet.h in Headers */ = {isa = PBXBuildFile; fileRef = 51FB67DA1AE6B5E400D06C5A /* ContentExtensionStyleSheet.h */; settings = {ATTRIBUTES = (Private, ); }; };
+               52131E591C4F15350033F802 /* WebVideoFullscreenInterface.h in Headers */ = {isa = PBXBuildFile; fileRef = 52131E581C4F15220033F802 /* WebVideoFullscreenInterface.h */; settings = {ATTRIBUTES = (Private, ); }; };
+               52131E5B1C4F15760033F802 /* WebVideoFullscreenInterfaceMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 52131E5A1C4F15610033F802 /* WebVideoFullscreenInterfaceMac.mm */; };
                521D46F611AEC98100514613 /* KillRingMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 521D46F511AEC98100514613 /* KillRingMac.mm */; };
                521D46F811AEC9B100514613 /* KillRing.h in Headers */ = {isa = PBXBuildFile; fileRef = 521D46F711AEC9B100514613 /* KillRing.h */; };
                52B6C9C215E3F4DF00690B05 /* DOMNamedFlowCollection.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 52B6C9BD15E3F4DF00690B05 /* DOMNamedFlowCollection.cpp */; };
                3F42B31B1881191B00278AAC /* WebVideoFullscreenControllerAVKit.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebVideoFullscreenControllerAVKit.h; sourceTree = "<group>"; };
                3F42B31C1881191B00278AAC /* WebVideoFullscreenControllerAVKit.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebVideoFullscreenControllerAVKit.mm; sourceTree = "<group>"; };
                3FBC4AE9189880EF0046EE38 /* WebVideoFullscreenModel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebVideoFullscreenModel.h; sourceTree = "<group>"; };
-               3FBC4AEB1898810E0046EE38 /* WebVideoFullscreenInterface.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebVideoFullscreenInterface.h; sourceTree = "<group>"; };
                3FBC4AF1189881560046EE38 /* WebVideoFullscreenInterfaceAVKit.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebVideoFullscreenInterfaceAVKit.mm; sourceTree = "<group>"; };
                3FBC4AF2189881560046EE38 /* WebVideoFullscreenInterfaceAVKit.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebVideoFullscreenInterfaceAVKit.h; sourceTree = "<group>"; };
                3FFFF9A6159D9A550020BBD5 /* WebKitCSSViewportRule.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebKitCSSViewportRule.cpp; sourceTree = "<group>"; };
                51FB5503113E3E9100821176 /* JSCloseEvent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSCloseEvent.cpp; sourceTree = "<group>"; };
                51FB67D91AE6B5E400D06C5A /* ContentExtensionStyleSheet.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ContentExtensionStyleSheet.cpp; sourceTree = "<group>"; };
                51FB67DA1AE6B5E400D06C5A /* ContentExtensionStyleSheet.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ContentExtensionStyleSheet.h; sourceTree = "<group>"; };
+               52131E581C4F15220033F802 /* WebVideoFullscreenInterface.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebVideoFullscreenInterface.h; sourceTree = "<group>"; };
+               52131E5A1C4F15610033F802 /* WebVideoFullscreenInterfaceMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebVideoFullscreenInterfaceMac.mm; sourceTree = "<group>"; };
                521D46F511AEC98100514613 /* KillRingMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = KillRingMac.mm; sourceTree = "<group>"; };
                521D46F711AEC9B100514613 /* KillRing.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = KillRing.h; sourceTree = "<group>"; };
                52B6C9BD15E3F4DF00690B05 /* DOMNamedFlowCollection.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DOMNamedFlowCollection.cpp; sourceTree = "<group>"; };
                                CD8203071395AB6A00F956C6 /* WebVideoFullscreenController.mm */,
                                CD8203081395AB6A00F956C6 /* WebVideoFullscreenHUDWindowController.h */,
                                CD8203091395AB6A00F956C6 /* WebVideoFullscreenHUDWindowController.mm */,
+                               52131E5A1C4F15610033F802 /* WebVideoFullscreenInterfaceMac.mm */,
                                CD82030E1395ACE700F956C6 /* WebWindowAnimation.h */,
                                CD82030F1395ACE700F956C6 /* WebWindowAnimation.mm */,
                                9380F47709A11ACC001FDB34 /* WidgetMac.mm */,
                                C2C4CB1D161A131200D214DA /* WebSafeIncrementalSweeperIOS.h */,
                                3F42B31B1881191B00278AAC /* WebVideoFullscreenControllerAVKit.h */,
                                3F42B31C1881191B00278AAC /* WebVideoFullscreenControllerAVKit.mm */,
-                               3FBC4AEB1898810E0046EE38 /* WebVideoFullscreenInterface.h */,
                                3FBC4AF2189881560046EE38 /* WebVideoFullscreenInterfaceAVKit.h */,
                                3FBC4AF1189881560046EE38 /* WebVideoFullscreenInterfaceAVKit.mm */,
                                3FBC4AE9189880EF0046EE38 /* WebVideoFullscreenModel.h */,
                                46DB7D561B20FE3C005651B2 /* VNodeTrackerCocoa.cpp */,
                                CDC979F21C498C0900DB50D4 /* WebCoreNSErrorExtras.mm */,
                                CDC979F31C498C0900DB50D4 /* WebCoreNSErrorExtras.h */,
+                               52131E581C4F15220033F802 /* WebVideoFullscreenInterface.h */,
                        );
                        path = cocoa;
                        sourceTree = "<group>";
                                CD82030A1395AB6A00F956C6 /* WebVideoFullscreenController.h in Headers */,
                                3F42B31D1881191B00278AAC /* WebVideoFullscreenControllerAVKit.h in Headers */,
                                CD82030C1395AB6A00F956C6 /* WebVideoFullscreenHUDWindowController.h in Headers */,
-                               3FBC4AEC1898810E0046EE38 /* WebVideoFullscreenInterface.h in Headers */,
+                               52131E591C4F15350033F802 /* WebVideoFullscreenInterface.h in Headers */,
                                3FBC4AF4189881560046EE38 /* WebVideoFullscreenInterfaceAVKit.h in Headers */,
                                3FBC4AEA189880EF0046EE38 /* WebVideoFullscreenModel.h in Headers */,
                                65FD466519B596F0001E2B4D /* WebVideoFullscreenModelVideoElement.h in Headers */,
                                3F42B31E1881191B00278AAC /* WebVideoFullscreenControllerAVKit.mm in Sources */,
                                CD82030D1395AB6A00F956C6 /* WebVideoFullscreenHUDWindowController.mm in Sources */,
                                3FBC4AF3189881560046EE38 /* WebVideoFullscreenInterfaceAVKit.mm in Sources */,
+                               52131E5B1C4F15760033F802 /* WebVideoFullscreenInterfaceMac.mm in Sources */,
                                65FD466619B596F6001E2B4D /* WebVideoFullscreenModelVideoElement.mm in Sources */,
                                F12171F516A8CED2000053CA /* WebVTTElement.cpp in Sources */,
                                5D21A80213ECE5DF00BB7064 /* WebVTTParser.cpp in Sources */,
index 1a81cea..edec540 100644 (file)
@@ -45,7 +45,7 @@
 #include <wtf/NeverDestroyed.h>
 
 #if ENABLE(VIDEO_PRESENTATION_MODE)
-#include "WebVideoFullscreenInterfaceAVKit.h"
+#include "WebVideoFullscreenInterface.h"
 #endif
 
 namespace WebCore {
@@ -373,8 +373,14 @@ bool HTMLVideoElement::webkitSupportsPresentationMode(const String& mode) const
     if (mode == presentationModeFullscreen())
         return mediaSession().fullscreenPermitted(*this) && supportsFullscreen();
 
-    if (mode == presentationModePictureInPicture())
-        return supportsPictureInPicture() && mediaSession().allowsPictureInPicture(*this) && supportsFullscreen();
+    if (mode == presentationModePictureInPicture()) {
+#if PLATFORM(COCOA)
+        if (!supportsPictureInPicture())
+            return false;
+#endif
+
+        return mediaSession().allowsPictureInPicture(*this) && supportsFullscreen();
+    }
 
     if (mode == presentationModeInline())
         return !mediaSession().requiresFullscreenForVideoPlayback(*this);
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2014 Apple Inc. All rights reserved.
+ * Copyright (C) 2014-2016 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-
 #ifndef WebVideoFullscreenInterface_h
 #define WebVideoFullscreenInterface_h
 
-#if PLATFORM(IOS)
+#if PLATFORM(IOS) || (PLATFORM(MAC) && ENABLE(VIDEO_PRESENTATION_MODE))
 
 #include <wtf/Vector.h>
 
@@ -36,7 +35,10 @@ class String;
 }
 
 namespace WebCore {
-    
+
+bool supportsPictureInPicture();
+
+#if PLATFORM(IOS)
 class TimeRanges;
 
 class WebVideoFullscreenInterface {
@@ -47,7 +49,7 @@ public:
     virtual void resetMediaState() = 0;
     virtual void setDuration(double) = 0;
     virtual void setCurrentTime(double currentTime, double anchorTime) = 0;
-    virtual void setBufferedTime(double bufferedTime) = 0;
+    virtual void setBufferedTime(double) = 0;
     virtual void setRate(bool isPlaying, float playbackRate) = 0;
     virtual void setVideoDimensions(bool hasVideo, float width, float height) = 0;
     virtual void setSeekableRanges(const TimeRanges&) = 0;
@@ -57,6 +59,7 @@ public:
     virtual void setExternalPlayback(bool enabled, ExternalPlaybackTargetType, WTF::String localizedDeviceName) = 0;
     virtual void setWirelessVideoPlaybackDisabled(bool) = 0;
 };
+#endif
 
 }
 
index fbf9e27..5ef29f5 100644 (file)
@@ -643,7 +643,7 @@ PlatformLayer* MediaPlayer::platformLayer() const
     return m_private->platformLayer();
 }
     
-#if PLATFORM(IOS)
+#if PLATFORM(IOS) || (PLATFORM(MAC) && ENABLE(VIDEO_PRESENTATION_MODE))
 void MediaPlayer::setVideoFullscreenLayer(PlatformLayer* layer)
 {
     m_private->setVideoFullscreenLayer(layer);
@@ -668,7 +668,9 @@ MediaPlayer::VideoFullscreenMode MediaPlayer::fullscreenMode() const
 {
     return m_client.mediaPlayerFullscreenMode();
 }
+#endif
 
+#if PLATFORM(IOS)
 NSArray* MediaPlayer::timedMetadata() const
 {
     return m_private->timedMetadata();
index 345775b..9af519f 100644 (file)
@@ -308,14 +308,17 @@ public:
     bool doesHaveAttribute(const AtomicString&, AtomicString* value = nullptr) const;
     PlatformMedia platformMedia() const;
     PlatformLayer* platformLayer() const;
-#if PLATFORM(IOS)
+
+#if PLATFORM(IOS) || (PLATFORM(MAC) && ENABLE(VIDEO_PRESENTATION_MODE))
     void setVideoFullscreenLayer(PlatformLayer*);
     void setVideoFullscreenFrame(FloatRect);
     using MediaPlayerEnums::VideoGravity;
     void setVideoFullscreenGravity(VideoGravity);
     void setVideoFullscreenMode(VideoFullscreenMode);
     VideoFullscreenMode fullscreenMode() const;
+#endif
 
+#if PLATFORM(IOS)
     NSArray *timedMetadata() const;
     String accessLog() const;
     String errorLog() const;
index 1f70ff0..e579ae9 100644 (file)
@@ -57,12 +57,15 @@ public:
     virtual void prepareToPlay() { }
     virtual PlatformMedia platformMedia() const { return NoPlatformMedia; }
     virtual PlatformLayer* platformLayer() const { return 0; }
-#if PLATFORM(IOS)
+
+#if PLATFORM(IOS) || (PLATFORM(MAC) && ENABLE(VIDEO_PRESENTATION_MODE))
     virtual void setVideoFullscreenLayer(PlatformLayer*) { }
     virtual void setVideoFullscreenFrame(FloatRect) { }
     virtual void setVideoFullscreenGravity(MediaPlayer::VideoGravity) { }
     virtual void setVideoFullscreenMode(MediaPlayer::VideoFullscreenMode) { }
+#endif
 
+#if PLATFORM(IOS)
     virtual NSArray *timedMetadata() const { return 0; }
     virtual String accessLog() const { return emptyString(); }
     virtual String errorLog() const { return emptyString(); }
diff --git a/Source/WebCore/platform/mac/WebVideoFullscreenInterfaceMac.mm b/Source/WebCore/platform/mac/WebVideoFullscreenInterfaceMac.mm
new file mode 100644 (file)
index 0000000..080d418
--- /dev/null
@@ -0,0 +1,36 @@
+/*
+ * Copyright (C) 2016 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.
+ */
+
+#import "config.h"
+#import "WebVideoFullscreenInterface.h"
+
+#if PLATFORM(MAC) && ENABLE(VIDEO_PRESENTATION_MODE)
+
+bool WebCore::supportsPictureInPicture()
+{
+    return false;
+}
+
+#endif
index beb0b77..1d66dfe 100644 (file)
@@ -1,3 +1,12 @@
+2016-01-19  Ada Chan  <adachan@apple.com>
+
+        Make it possible to enable VIDEO_PRESENTATION_MODE on other Cocoa platforms.
+        https://bugs.webkit.org/show_bug.cgi?id=153218
+
+        Reviewed by Eric Carlson.
+
+        * Configurations/FeatureDefines.xcconfig:
+
 2016-01-19  Beth Dakin  <bdakin@apple.com>
 
         32-bit build fix.
index 57bcdd4..f3ca632 100644 (file)
@@ -170,6 +170,10 @@ ENABLE_TOUCH_ICON_LOADING = ;
 ENABLE_USERSELECT_ALL = ENABLE_USERSELECT_ALL;
 ENABLE_VIDEO = ENABLE_VIDEO;
 ENABLE_VIDEO_PRESENTATION_MODE[sdk=iphone*] = ENABLE_VIDEO_PRESENTATION_MODE;
+ENABLE_VIDEO_PRESENTATION_MODE[sdk=macosx*] = $(ENABLE_VIDEO_PRESENTATION_MODE_macosx_$(TARGET_MAC_OS_X_VERSION_MAJOR))
+ENABLE_VIDEO_PRESENTATION_MODE_macosx_101000 = ;
+ENABLE_VIDEO_PRESENTATION_MODE_macosx_101100 = ;
+ENABLE_VIDEO_PRESENTATION_MODE_macosx_101200 = ENABLE_VIDEO_PRESENTATION_MODE;
 ENABLE_VIDEO_TRACK = ENABLE_VIDEO_TRACK;
 ENABLE_DATACUE_VALUE = ENABLE_DATACUE_VALUE;
 ENABLE_VIEW_MODE_CSS_MEDIA = ;
index ff1a407..5796d6d 100644 (file)
@@ -1,3 +1,12 @@
+2016-01-19  Ada Chan  <adachan@apple.com>
+
+        Make it possible to enable VIDEO_PRESENTATION_MODE on other Cocoa platforms.
+        https://bugs.webkit.org/show_bug.cgi?id=153218
+
+        Reviewed by Eric Carlson.
+
+        * Configurations/FeatureDefines.xcconfig:
+
 2016-01-20  Alex Christensen  <achristensen@webkit.org>
 
         Fix CMake build after r195300.
index 57bcdd4..f3ca632 100644 (file)
@@ -170,6 +170,10 @@ ENABLE_TOUCH_ICON_LOADING = ;
 ENABLE_USERSELECT_ALL = ENABLE_USERSELECT_ALL;
 ENABLE_VIDEO = ENABLE_VIDEO;
 ENABLE_VIDEO_PRESENTATION_MODE[sdk=iphone*] = ENABLE_VIDEO_PRESENTATION_MODE;
+ENABLE_VIDEO_PRESENTATION_MODE[sdk=macosx*] = $(ENABLE_VIDEO_PRESENTATION_MODE_macosx_$(TARGET_MAC_OS_X_VERSION_MAJOR))
+ENABLE_VIDEO_PRESENTATION_MODE_macosx_101000 = ;
+ENABLE_VIDEO_PRESENTATION_MODE_macosx_101100 = ;
+ENABLE_VIDEO_PRESENTATION_MODE_macosx_101200 = ENABLE_VIDEO_PRESENTATION_MODE;
 ENABLE_VIDEO_TRACK = ENABLE_VIDEO_TRACK;
 ENABLE_DATACUE_VALUE = ENABLE_DATACUE_VALUE;
 ENABLE_VIEW_MODE_CSS_MEDIA = ;