Add hasVideo property to WebAVPlayerController.
authorpvollan@apple.com <pvollan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 7 Apr 2017 13:43:37 +0000 (13:43 +0000)
committerpvollan@apple.com <pvollan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 7 Apr 2017 13:43:37 +0000 (13:43 +0000)
https://bugs.webkit.org/show_bug.cgi?id=170545
rdar://problem/31325182

Reviewed by Eric Carlson.

Add a new "hasVideo" property which can be used to discover if any video content is present in the playback item,
whether video content is currently enabled or not.

* platform/ios/WebAVPlayerController.h:
* platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
(WebVideoFullscreenInterfaceAVKit::hasVideoChanged):

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

Source/WebCore/ChangeLog
Source/WebCore/platform/ios/WebAVPlayerController.h
Source/WebCore/platform/ios/WebVideoFullscreenInterfaceAVKit.mm

index 03436bc..30bf04c 100644 (file)
@@ -1,3 +1,18 @@
+2017-04-07  Per Arne Vollan  <pvollan@apple.com>
+
+        Add hasVideo property to WebAVPlayerController.
+        https://bugs.webkit.org/show_bug.cgi?id=170545
+        rdar://problem/31325182
+
+        Reviewed by Eric Carlson.
+
+        Add a new "hasVideo" property which can be used to discover if any video content is present in the playback item,
+        whether video content is currently enabled or not.
+
+        * platform/ios/WebAVPlayerController.h:
+        * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
+        (WebVideoFullscreenInterfaceAVKit::hasVideoChanged):
+
 2017-04-07  Miguel Gomez  <magomez@igalia.com>
 
         [GTK+] Animations not played properly when using synchronous decoding
index 3691b65..ce25b58 100644 (file)
@@ -61,6 +61,7 @@ class WebPlaybackSessionInterfaceAVKit;
 @property CGSize contentDimensions;
 @property BOOL hasEnabledAudio;
 @property BOOL hasEnabledVideo;
+@property BOOL hasVideo;
 @property NSTimeInterval minTime;
 @property NSTimeInterval maxTime;
 @property NSTimeInterval contentDurationWithinEndTimes;
index 18d9a0f..f3fc2ae 100644 (file)
@@ -536,6 +536,7 @@ void WebVideoFullscreenInterfaceAVKit::setWebVideoFullscreenChangeObserver(WebVi
 void WebVideoFullscreenInterfaceAVKit::hasVideoChanged(bool hasVideo)
 {
     [playerController() setHasEnabledVideo:hasVideo];
+    [playerController() setHasVideo:hasVideo];
 }
 
 void WebVideoFullscreenInterfaceAVKit::videoDimensionsChanged(const FloatSize& videoDimensions)
@@ -549,7 +550,7 @@ void WebVideoFullscreenInterfaceAVKit::videoDimensionsChanged(const FloatSize& v
     WebAVPictureInPicturePlayerLayerView *pipView = (WebAVPictureInPicturePlayerLayerView *)[m_playerLayerView pictureInPicturePlayerLayerView];
     WebAVPlayerLayer *pipPlayerLayer = (WebAVPlayerLayer *)[pipView layer];
     [pipPlayerLayer setVideoDimensions:playerLayer.videoDimensions];
-    [pipView setNeedsLayout];    
+    [pipView setNeedsLayout];
 }
 
 void WebVideoFullscreenInterfaceAVKit::externalPlaybackChanged(bool enabled, WebPlaybackSessionModel::ExternalPlaybackTargetType, const String&)