Changeset 220496 in webkit
- Timestamp:
- Aug 9, 2017 4:18:13 PM (7 years ago)
- Location:
- trunk/Source
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r220488 r220496 1 2017-08-09 Jeremy Jones <jeremyj@apple.com> 2 3 Use MPAVRoutingController instead of deprecated versions. 4 https://bugs.webkit.org/show_bug.cgi?id=175063 5 6 Reviewed by Tim Horton. 7 8 No new tests because no behavior change. This uses a different platform class to present 9 an interface. 10 11 Remove deprecated MPAudioVideoRoutingPopoverController and MPAVRoutingSheet 12 Add MPMediaControlsViewController. 13 14 * platform/spi/ios/MediaPlayerSPI.h: 15 1 16 2017-08-09 Myles C. Maxfield <mmaxfield@apple.com> 2 17 -
trunk/Source/WebCore/platform/spi/ios/MediaPlayerSPI.h
r220293 r220496 34 34 35 35 #import <MediaPlayer/MPAVRoutingController.h> 36 37 #if __IPHONE_OS_VERSION_MIN_REQUIRED >= 110000 && !PLATFORM(WATCHOS) && !PLATFORM(APPLETV) 38 #import <MediaPlayer/MPMediaControlsViewController.h> 39 #else 36 40 #import <MediaPlayer/MPAVRoutingSheet.h> 37 41 #import <MediaPlayer/MPAudioVideoRoutingPopoverController.h> 42 #endif 38 43 39 44 #else 40 45 41 enum { 42 MPAVItemTypeUnknown = 0, 43 MPAVItemTypeAudio = 1, 44 MPAVItemTypeVideo = 2, 45 }; 46 typedef NSUInteger MPAVItemType; 46 NS_ASSUME_NONNULL_BEGIN 47 47 48 48 enum { … … 60 60 @property (nonatomic, assign) MPRouteDiscoveryMode discoveryMode; 61 61 @end 62 63 #if __IPHONE_OS_VERSION_MIN_REQUIRED >= 110000 && !PLATFORM(WATCHOS) && !PLATFORM(APPLETV) 64 65 @interface MPMediaControlsViewController : UIViewController 66 @property (nonatomic, copy, nullable) void (^didDismissHandler)(void); 67 @end 68 69 #else 70 71 enum { 72 MPAVItemTypeUnknown = 0, 73 MPAVItemTypeAudio = 1, 74 MPAVItemTypeVideo = 2, 75 }; 76 typedef NSUInteger MPAVItemType; 62 77 63 78 #pragma clang diagnostic push … … 79 94 @interface MPAVRoutingSheet () 80 95 @property (nonatomic, assign, setter=setAVItemType:) MPAVItemType avItemType; 81 82 96 @property (nonatomic, assign) BOOL mirroringOnly; 83 84 97 - (id)initWithAVItemType:(MPAVItemType)avItemType; 85 86 98 - (void)showInView:(UIView *)view withCompletionHandler:(void (^)(void))completionHandler; 87 88 99 - (void)dismiss; 89 100 @end … … 91 102 #endif 92 103 104 NS_ASSUME_NONNULL_END 105 93 106 #endif 107 108 #endif // PLATFORM(IOS) -
trunk/Source/WebKit/ChangeLog
r220478 r220496 1 2017-08-09 Jeremy Jones <jeremyj@apple.com> 2 3 Use MPAVRoutingController instead of deprecated versions. 4 https://bugs.webkit.org/show_bug.cgi?id=175063 5 rdar://problem/33301230 6 7 Reviewed by Tim Horton. 8 9 Remove dependence on deprecated classes MPAVRoutingSheet and MPAudioVideoRoutingPopoverController. 10 11 * UIProcess/ios/forms/WKAirPlayRoutePicker.h: 12 * UIProcess/ios/forms/WKAirPlayRoutePicker.mm: 13 (-[WKAirPlayRoutePicker dealloc]): 14 (-[WKAirPlayRoutePicker show:fromRect:]): 15 (-[WKAirPlayRoutePicker popoverControllerDidDismissPopover:]): Deleted. 16 (-[WKAirPlayRoutePicker _presentAirPlayPopoverAnimated:fromRect:]): Deleted. 17 (-[WKAirPlayRoutePicker _windowWillRotate:]): Deleted. 18 (-[WKAirPlayRoutePicker _windowDidRotate:]): Deleted. 19 (-[WKAirPlayRoutePicker _dismissAirPlayRoutePickerIPad]): Deleted. 20 (-[WKAirPlayRoutePicker showAirPlayPickerIPad:fromRect:]): Deleted. 21 (-[WKAirPlayRoutePicker showAirPlayPickerIPhone:]): Deleted. 22 1 23 2017-08-09 Sam Weinig <sam@webkit.org> 2 24 -
trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm
r220443 r220496 4001 4001 - (void)_showPlaybackTargetPicker:(BOOL)hasVideo fromRect:(const IntRect&)elementRect 4002 4002 { 4003 #if __IPHONE_OS_VERSION_MIN_REQUIRED >= 110000 && !PLATFORM(WATCHOS) && !PLATFORM(APPLETV) 4004 if (!_airPlayRoutePicker) 4005 _airPlayRoutePicker = adoptNS([[WKAirPlayRoutePicker alloc] init]); 4006 [_airPlayRoutePicker showFromView:self]; 4007 #else 4003 4008 if (!_airPlayRoutePicker) 4004 4009 _airPlayRoutePicker = adoptNS([[WKAirPlayRoutePicker alloc] initWithView:self]); 4005 4010 [_airPlayRoutePicker show:hasVideo fromRect:elementRect]; 4011 #endif 4006 4012 } 4007 4013 -
trunk/Source/WebKit/UIProcess/ios/forms/WKAirPlayRoutePicker.h
r220293 r220496 26 26 #if PLATFORM(IOS) 27 27 28 #if __IPHONE_OS_VERSION_MIN_REQUIRED >= 110000 && !PLATFORM(WATCHOS) && !PLATFORM(APPLETV) 29 30 #import <Foundation/Foundation.h> 31 32 @class UIView; 33 34 @interface WKAirPlayRoutePicker : NSObject 35 - (void)showFromView:(UIView *)view; 36 @end 37 38 #else 39 28 40 #import <UIKit/UIPopoverController.h> 29 41 … … 35 47 @end 36 48 49 #endif 50 37 51 #endif // PLATFORM(IOS) 38 52 -
trunk/Source/WebKit/UIProcess/ios/forms/WKAirPlayRoutePicker.mm
r220293 r220496 30 30 31 31 #import "UIKitSPI.h" 32 #import <WebCore/MediaPlayerSPI.h> 33 #import <wtf/RetainPtr.h> 34 #import <wtf/SoftLinking.h> 35 36 #if __IPHONE_OS_VERSION_MIN_REQUIRED < 110000 || PLATFORM(WATCHOS) || PLATFORM(APPLETV) 32 37 #import "WKContentView.h" 33 38 #import "WKContentViewInteraction.h" 34 39 #import "WebPageProxy.h" 35 #import <WebCore/MediaPlayerSPI.h>36 #import <wtf/RetainPtr.h>37 #import <wtf/SoftLinking.h>38 40 39 41 #pragma clang diagnostic push … … 160 162 #pragma clang diagnostic pop 161 163 164 #else 165 166 SOFT_LINK_FRAMEWORK(MediaPlayer) 167 SOFT_LINK_CLASS(MediaPlayer, MPAVRoutingController) 168 SOFT_LINK_CLASS(MediaPlayer, MPMediaControlsViewController) 169 170 @implementation WKAirPlayRoutePicker { 171 RetainPtr<MPMediaControlsViewController> _actionSheet; 172 } 173 174 - (void)dealloc 175 { 176 [_actionSheet dismissViewControllerAnimated:0 completion:nil]; 177 [super dealloc]; 178 } 179 180 - (void)showFromView:(UIView *)view 181 { 182 if (_actionSheet) 183 return; 184 185 __block RetainPtr<MPAVRoutingController> routingController = adoptNS([allocMPAVRoutingControllerInstance() initWithName:@"WebKit - HTML media element showing AirPlay route picker"]); 186 [routingController setDiscoveryMode:MPRouteDiscoveryModeDetailed]; 187 188 _actionSheet = adoptNS([allocMPMediaControlsViewControllerInstance() init]); 189 _actionSheet.get().didDismissHandler = ^ { 190 [routingController setDiscoveryMode:MPRouteDiscoveryModeDisabled]; 191 routingController = nil; 192 _actionSheet = nil; 193 }; 194 195 UIViewController *viewControllerForPresentation = [UIViewController _viewControllerForFullScreenPresentationFromView:view]; 196 [viewControllerForPresentation presentViewController:_actionSheet.get() animated:YES completion:nil]; 197 } 198 199 @end 200 201 #endif 202 162 203 #endif // PLATFORM(IOS)
Note: See TracChangeset
for help on using the changeset viewer.