Title: [273186] trunk/Source/WebKit
Revision
273186
Author
katherine_che...@apple.com
Date
2021-02-19 17:07:46 -0800 (Fri, 19 Feb 2021)

Log Message

Add back old media playback API but deprecated
https://bugs.webkit.org/show_bug.cgi?id=222206
<rdar://problem/74539125>

We should add these back in case clients adopted them before the name
update in https://trac.webkit.org/changeset/272923/webkit.

Reviewed by Tim Horton.

* UIProcess/API/Cocoa/WKWebView.h:
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView pauseAllMediaPlayback:]):
(-[WKWebView suspendAllMediaPlayback:]):
(-[WKWebView resumeAllMediaPlayback:]):
(-[WKWebView closeAllMediaPresentations:]):
(-[WKWebView requestMediaPlaybackState:]):

Modified Paths

Diff

Modified: trunk/Source/WebKit/ChangeLog (273185 => 273186)


--- trunk/Source/WebKit/ChangeLog	2021-02-20 00:55:59 UTC (rev 273185)
+++ trunk/Source/WebKit/ChangeLog	2021-02-20 01:07:46 UTC (rev 273186)
@@ -1,3 +1,22 @@
+2021-02-19  Kate Cheney  <katherine_che...@apple.com>
+
+        Add back old media playback API but deprecated
+        https://bugs.webkit.org/show_bug.cgi?id=222206
+        <rdar://problem/74539125>
+
+        We should add these back in case clients adopted them before the name
+        update in https://trac.webkit.org/changeset/272923/webkit.
+
+        Reviewed by Tim Horton.
+
+        * UIProcess/API/Cocoa/WKWebView.h:
+        * UIProcess/API/Cocoa/WKWebView.mm:
+        (-[WKWebView pauseAllMediaPlayback:]):
+        (-[WKWebView suspendAllMediaPlayback:]):
+        (-[WKWebView resumeAllMediaPlayback:]):
+        (-[WKWebView closeAllMediaPresentations:]):
+        (-[WKWebView requestMediaPlaybackState:]):
+
 2021-02-19  Wenson Hsieh  <wenson_hs...@apple.com>
 
         [iOS] Specify a _UIDataOwner when reading or writing from the system pasteboard

Modified: trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebView.h (273185 => 273186)


--- trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebView.h	2021-02-20 00:55:59 UTC (rev 273185)
+++ trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebView.h	2021-02-20 01:07:46 UTC (rev 273186)
@@ -526,6 +526,12 @@
 
 @property (nonatomic, readonly, copy) NSArray *certificateChain WK_API_DEPRECATED_WITH_REPLACEMENT("serverTrust", macos(10.11, 10.12), ios(9.0, 10.0));
 
+- (void)pauseAllMediaPlayback:(void (^_Nullable)(void))completionHandler WK_API_DEPRECATED_WITH_REPLACEMENT("pauseAllMediaPlaybackWithCompletionHandler", macos(WK_MAC_TBA, WK_MAC_TBA), ios(WK_IOS_TBA, WK_IOS_TBA));
+- (void)suspendAllMediaPlayback:(void (^_Nullable)(void))completionHandler WK_API_DEPRECATED_WITH_REPLACEMENT("setAllMediaPlaybackSuspended:suspended", macos(WK_MAC_TBA, WK_MAC_TBA), ios(WK_IOS_TBA, WK_IOS_TBA));
+- (void)resumeAllMediaPlayback:(void (^ _Nullable)(void))completionHandler WK_API_DEPRECATED_WITH_REPLACEMENT("setAllMediaPlaybackSuspended:suspended", macos(WK_MAC_TBA, WK_MAC_TBA), ios(WK_IOS_TBA, WK_IOS_TBA));
+- (void)closeAllMediaPresentations:(void (^_Nullable)(void))completionHandler WK_API_DEPRECATED_WITH_REPLACEMENT("closeAllMediaPresentationsWithCompletionHandler", macos(WK_MAC_TBA, WK_MAC_TBA), ios(WK_IOS_TBA, WK_IOS_TBA));
+- (void)requestMediaPlaybackState:(void (^)(WKMediaPlaybackState))completionHandler WK_API_DEPRECATED_WITH_REPLACEMENT("requestMediaPlaybackStateWithCompletionHandler", macos(WK_MAC_TBA, WK_MAC_TBA), ios(WK_IOS_TBA, WK_IOS_TBA));
+
 @end
 
 NS_ASSUME_NONNULL_END

Modified: trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm (273185 => 273186)


--- trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm	2021-02-20 00:55:59 UTC (rev 273185)
+++ trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm	2021-02-20 01:07:46 UTC (rev 273186)
@@ -3247,6 +3247,31 @@
     return (__bridge NSArray *)certificateInfo->certificateInfo().certificateChain() ?: @[ ];
 }
 
+- (void)pauseAllMediaPlayback:(void (^)(void))completionHandler
+{
+    [self pauseAllMediaPlaybackWithCompletionHandler:completionHandler];
+}
+
+- (void)suspendAllMediaPlayback:(void (^)(void))completionHandler
+{
+    [self setAllMediaPlaybackSuspended:YES completionHandler:completionHandler];
+}
+
+- (void)resumeAllMediaPlayback:(void (^)(void))completionHandler
+{
+    [self setAllMediaPlaybackSuspended:NO completionHandler:completionHandler];
+}
+
+- (void)closeAllMediaPresentations:(void (^)(void))completionHandler
+{
+    [self closeAllMediaPresentationsWithCompletionHandler:completionHandler];
+}
+
+- (void)requestMediaPlaybackState:(void (^)(WKMediaPlaybackState))completionHandler
+{
+    [self requestMediaPlaybackStateWithCompletionHandler:completionHandler];
+}
+
 @end
 
 @implementation WKWebView (WKBinaryCompatibilityWithIOS10)
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to