Title: [223088] branches/safari-604-branch/Source

Diff

Modified: branches/safari-604-branch/Source/WebCore/ChangeLog (223087 => 223088)


--- branches/safari-604-branch/Source/WebCore/ChangeLog	2017-10-10 00:05:23 UTC (rev 223087)
+++ branches/safari-604-branch/Source/WebCore/ChangeLog	2017-10-10 00:07:36 UTC (rev 223088)
@@ -1,3 +1,22 @@
+2017-10-02  Jason Marcell  <[email protected]>
+
+        Cherry-pick r220496. rdar://problem/34770816
+
+    2017-08-09  Jeremy Jones  <[email protected]>
+
+            Use MPAVRoutingController instead of deprecated versions.
+            https://bugs.webkit.org/show_bug.cgi?id=175063
+
+            Reviewed by Tim Horton.
+
+            No new tests because no behavior change. This uses a different platform class to present
+            an interface.
+
+            Remove deprecated MPAudioVideoRoutingPopoverController and MPAVRoutingSheet
+            Add MPMediaControlsViewController.
+
+            * platform/spi/ios/MediaPlayerSPI.h:
+
 2017-10-04  Kocsen Chung  <[email protected]>
 
         Revert r222779. rdar://problem/34706688

Modified: branches/safari-604-branch/Source/WebCore/platform/spi/ios/MediaPlayerSPI.h (223087 => 223088)


--- branches/safari-604-branch/Source/WebCore/platform/spi/ios/MediaPlayerSPI.h	2017-10-10 00:05:23 UTC (rev 223087)
+++ branches/safari-604-branch/Source/WebCore/platform/spi/ios/MediaPlayerSPI.h	2017-10-10 00:07:36 UTC (rev 223088)
@@ -33,17 +33,17 @@
 #if USE(APPLE_INTERNAL_SDK)
 
 #import <MediaPlayer/MPAVRoutingController.h>
+
+#if __IPHONE_OS_VERSION_MIN_REQUIRED >= 110000 && !PLATFORM(WATCHOS) && !PLATFORM(APPLETV)
+#import <MediaPlayer/MPMediaControlsViewController.h>
+#else
 #import <MediaPlayer/MPAVRoutingSheet.h>
 #import <MediaPlayer/MPAudioVideoRoutingPopoverController.h>
+#endif
 
 #else
 
-enum {
-    MPAVItemTypeUnknown = 0,
-    MPAVItemTypeAudio = 1,
-    MPAVItemTypeVideo = 2,
-};
-typedef NSUInteger MPAVItemType;
+NS_ASSUME_NONNULL_BEGIN
 
 enum {
     MPRouteDiscoveryModeDisabled = 0,
@@ -60,6 +60,21 @@
 @property (nonatomic, assign) MPRouteDiscoveryMode discoveryMode;
 @end
 
+#if __IPHONE_OS_VERSION_MIN_REQUIRED >= 110000 && !PLATFORM(WATCHOS) && !PLATFORM(APPLETV)
+
+@interface MPMediaControlsViewController : UIViewController
+@property (nonatomic, copy, nullable) void (^didDismissHandler)(void);
+@end
+
+#else
+
+enum {
+    MPAVItemTypeUnknown = 0,
+    MPAVItemTypeAudio = 1,
+    MPAVItemTypeVideo = 2,
+};
+typedef NSUInteger MPAVItemType;
+
 #pragma clang diagnostic push
 #pragma clang diagnostic ignored "-Wdeprecated-declarations"
 @interface MPAudioVideoRoutingPopoverController : UIPopoverController
@@ -78,16 +93,16 @@
 
 @interface MPAVRoutingSheet ()
 @property (nonatomic, assign, setter=setAVItemType:) MPAVItemType avItemType;
-
 @property (nonatomic, assign) BOOL mirroringOnly;
-
 - (id)initWithAVItemType:(MPAVItemType)avItemType;
-
 - (void)showInView:(UIView *)view withCompletionHandler:(void (^)(void))completionHandler;
-
 - (void)dismiss;
 @end
 
 #endif
 
+NS_ASSUME_NONNULL_END
+
 #endif
+
+#endif // PLATFORM(IOS)

Modified: branches/safari-604-branch/Source/WebKit/ChangeLog (223087 => 223088)


--- branches/safari-604-branch/Source/WebKit/ChangeLog	2017-10-10 00:05:23 UTC (rev 223087)
+++ branches/safari-604-branch/Source/WebKit/ChangeLog	2017-10-10 00:07:36 UTC (rev 223088)
@@ -1,3 +1,29 @@
+2017-10-02  Jason Marcell  <[email protected]>
+
+        Cherry-pick r220496. rdar://problem/34770816
+
+    2017-08-09  Jeremy Jones  <[email protected]>
+
+            Use MPAVRoutingController instead of deprecated versions.
+            https://bugs.webkit.org/show_bug.cgi?id=175063
+            rdar://problem/33301230
+
+            Reviewed by Tim Horton.
+
+            Remove dependence on deprecated classes MPAVRoutingSheet and MPAudioVideoRoutingPopoverController.
+
+            * UIProcess/ios/forms/WKAirPlayRoutePicker.h:
+            * UIProcess/ios/forms/WKAirPlayRoutePicker.mm:
+            (-[WKAirPlayRoutePicker dealloc]):
+            (-[WKAirPlayRoutePicker show:fromRect:]):
+            (-[WKAirPlayRoutePicker popoverControllerDidDismissPopover:]): Deleted.
+            (-[WKAirPlayRoutePicker _presentAirPlayPopoverAnimated:fromRect:]): Deleted.
+            (-[WKAirPlayRoutePicker _windowWillRotate:]): Deleted.
+            (-[WKAirPlayRoutePicker _windowDidRotate:]): Deleted.
+            (-[WKAirPlayRoutePicker _dismissAirPlayRoutePickerIPad]): Deleted.
+            (-[WKAirPlayRoutePicker showAirPlayPickerIPad:fromRect:]): Deleted.
+            (-[WKAirPlayRoutePicker showAirPlayPickerIPhone:]): Deleted.
+
 2017-10-05  Matthew Hanson  <[email protected]>
 
         Revert r222431. rdar://problem/34826998

Modified: branches/safari-604-branch/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm (223087 => 223088)


--- branches/safari-604-branch/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm	2017-10-10 00:05:23 UTC (rev 223087)
+++ branches/safari-604-branch/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm	2017-10-10 00:07:36 UTC (rev 223088)
@@ -4000,9 +4000,15 @@
 
 - (void)_showPlaybackTargetPicker:(BOOL)hasVideo fromRect:(const IntRect&)elementRect
 {
+#if __IPHONE_OS_VERSION_MIN_REQUIRED >= 110000 && !PLATFORM(WATCHOS) && !PLATFORM(APPLETV)
     if (!_airPlayRoutePicker)
+        _airPlayRoutePicker = adoptNS([[WKAirPlayRoutePicker alloc] init]);
+    [_airPlayRoutePicker showFromView:self];
+#else
+    if (!_airPlayRoutePicker)
         _airPlayRoutePicker = adoptNS([[WKAirPlayRoutePicker alloc] initWithView:self]);
     [_airPlayRoutePicker show:hasVideo fromRect:elementRect];
+#endif
 }
 
 - (void)_showRunOpenPanel:(API::OpenPanelParameters*)parameters resultListener:(WebOpenPanelResultListenerProxy*)listener

Modified: branches/safari-604-branch/Source/WebKit/UIProcess/ios/forms/WKAirPlayRoutePicker.h (223087 => 223088)


--- branches/safari-604-branch/Source/WebKit/UIProcess/ios/forms/WKAirPlayRoutePicker.h	2017-10-10 00:05:23 UTC (rev 223087)
+++ branches/safari-604-branch/Source/WebKit/UIProcess/ios/forms/WKAirPlayRoutePicker.h	2017-10-10 00:07:36 UTC (rev 223088)
@@ -25,6 +25,18 @@
 
 #if PLATFORM(IOS)
 
+#if __IPHONE_OS_VERSION_MIN_REQUIRED >= 110000 && !PLATFORM(WATCHOS) && !PLATFORM(APPLETV)
+
+#import <Foundation/Foundation.h>
+
+@class UIView;
+
+@interface WKAirPlayRoutePicker : NSObject
+- (void)showFromView:(UIView *)view;
+@end
+
+#else
+
 #import <UIKit/UIPopoverController.h>
 
 @class WKContentView;
@@ -34,5 +46,7 @@
 - (void)show:(BOOL)hasVideo fromRect:(CGRect)elementRect;
 @end
 
+#endif
+
 #endif // PLATFORM(IOS)
 

Modified: branches/safari-604-branch/Source/WebKit/UIProcess/ios/forms/WKAirPlayRoutePicker.mm (223087 => 223088)


--- branches/safari-604-branch/Source/WebKit/UIProcess/ios/forms/WKAirPlayRoutePicker.mm	2017-10-10 00:05:23 UTC (rev 223087)
+++ branches/safari-604-branch/Source/WebKit/UIProcess/ios/forms/WKAirPlayRoutePicker.mm	2017-10-10 00:07:36 UTC (rev 223088)
@@ -29,13 +29,15 @@
 #if PLATFORM(IOS)
 
 #import "UIKitSPI.h"
-#import "WKContentView.h"
-#import "WKContentViewInteraction.h"
-#import "WebPageProxy.h"
 #import <WebCore/MediaPlayerSPI.h>
 #import <wtf/RetainPtr.h>
 #import <wtf/SoftLinking.h>
 
+#if __IPHONE_OS_VERSION_MIN_REQUIRED < 110000 || PLATFORM(WATCHOS) || PLATFORM(APPLETV)
+#import "WKContentView.h"
+#import "WKContentViewInteraction.h"
+#import "WebPageProxy.h"
+
 #pragma clang diagnostic push
 #pragma clang diagnostic ignored "-Wdeprecated-declarations"
 
@@ -159,4 +161,43 @@
 
 #pragma clang diagnostic pop
 
+#else 
+
+SOFT_LINK_FRAMEWORK(MediaPlayer)
+SOFT_LINK_CLASS(MediaPlayer, MPAVRoutingController)
+SOFT_LINK_CLASS(MediaPlayer, MPMediaControlsViewController)
+
+@implementation WKAirPlayRoutePicker {
+    RetainPtr<MPMediaControlsViewController> _actionSheet;
+}
+
+- (void)dealloc
+{
+    [_actionSheet dismissViewControllerAnimated:0 completion:nil];
+    [super dealloc];
+}
+
+- (void)showFromView:(UIView *)view
+{
+    if (_actionSheet)
+        return;
+
+    __block RetainPtr<MPAVRoutingController> routingController = adoptNS([allocMPAVRoutingControllerInstance() initWithName:@"WebKit - HTML media element showing AirPlay route picker"]);
+    [routingController setDiscoveryMode:MPRouteDiscoveryModeDetailed];
+
+    _actionSheet = adoptNS([allocMPMediaControlsViewControllerInstance() init]);
+    _actionSheet.get().didDismissHandler = ^ {
+        [routingController setDiscoveryMode:MPRouteDiscoveryModeDisabled];
+        routingController = nil;
+        _actionSheet = nil;
+    };
+
+    UIViewController *viewControllerForPresentation = [UIViewController _viewControllerForFullScreenPresentationFromView:view];
+    [viewControllerForPresentation presentViewController:_actionSheet.get() animated:YES completion:nil];
+}
+
+@end
+
+#endif
+
 #endif // PLATFORM(IOS)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to