Title: [283005] branches/safari-612-branch/Source/WebCore
Revision
283005
Author
[email protected]
Date
2021-09-23 13:42:04 -0700 (Thu, 23 Sep 2021)

Log Message

Cherry-pick r282046. rdar://problem/83463331

    [iOS] Play/pause button's icon does not update when pausing in full screen
    https://bugs.webkit.org/show_bug.cgi?id=229904

    Reviewed by Eric Carlson.

    AVKit expects KVO notification of `rate` to update the play/pause icon.
    However, with the changes in r280840, `-[WebAVPlayerController setRate]`
    will be called by AVKit only. When a user taps the play/pause button,
    `-[WebAVPlayerController setRate:fromJavaScript:]` will be called, which
    does not generate the KVO notification.

    This patch fixes the issue by manually generate the KVO notification.

    To be safe, this patch manually generates the KVO notification for
    property `defaultPlaybackRate` as well.

    Tested manually.

    * platform/ios/WebAVPlayerController.mm:
    (-[WebAVPlayerController setDefaultPlaybackRate:fromJavaScript:]):
    (-[WebAVPlayerController setRate:fromJavaScript:]):

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

Modified Paths

Diff

Modified: branches/safari-612-branch/Source/WebCore/ChangeLog (283004 => 283005)


--- branches/safari-612-branch/Source/WebCore/ChangeLog	2021-09-23 20:30:13 UTC (rev 283004)
+++ branches/safari-612-branch/Source/WebCore/ChangeLog	2021-09-23 20:42:04 UTC (rev 283005)
@@ -1,5 +1,58 @@
 2021-09-23  Russell Epstein  <[email protected]>
 
+        Cherry-pick r282046. rdar://problem/83463331
+
+    [iOS] Play/pause button's icon does not update when pausing in full screen
+    https://bugs.webkit.org/show_bug.cgi?id=229904
+    
+    Reviewed by Eric Carlson.
+    
+    AVKit expects KVO notification of `rate` to update the play/pause icon.
+    However, with the changes in r280840, `-[WebAVPlayerController setRate]`
+    will be called by AVKit only. When a user taps the play/pause button,
+    `-[WebAVPlayerController setRate:fromJavaScript:]` will be called, which
+    does not generate the KVO notification.
+    
+    This patch fixes the issue by manually generate the KVO notification.
+    
+    To be safe, this patch manually generates the KVO notification for
+    property `defaultPlaybackRate` as well.
+    
+    Tested manually.
+    
+    * platform/ios/WebAVPlayerController.mm:
+    (-[WebAVPlayerController setDefaultPlaybackRate:fromJavaScript:]):
+    (-[WebAVPlayerController setRate:fromJavaScript:]):
+    
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@282046 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2021-09-04  Peng Liu  <[email protected]>
+
+            [iOS] Play/pause button's icon does not update when pausing in full screen
+            https://bugs.webkit.org/show_bug.cgi?id=229904
+
+            Reviewed by Eric Carlson.
+
+            AVKit expects KVO notification of `rate` to update the play/pause icon.
+            However, with the changes in r280840, `-[WebAVPlayerController setRate]`
+            will be called by AVKit only. When a user taps the play/pause button,
+            `-[WebAVPlayerController setRate:fromJavaScript:]` will be called, which
+            does not generate the KVO notification.
+
+            This patch fixes the issue by manually generate the KVO notification.
+
+            To be safe, this patch manually generates the KVO notification for
+            property `defaultPlaybackRate` as well.
+
+            Tested manually.
+
+            * platform/ios/WebAVPlayerController.mm:
+            (-[WebAVPlayerController setDefaultPlaybackRate:fromJavaScript:]):
+            (-[WebAVPlayerController setRate:fromJavaScript:]):
+
+2021-09-23  Russell Epstein  <[email protected]>
+
         Cherry-pick r282451. rdar://problem/83460818
 
     [iOS] Search inputs with '-webkit-appearance: textfield' should have a textfield background color

Modified: branches/safari-612-branch/Source/WebCore/platform/ios/WebAVPlayerController.mm (283004 => 283005)


--- branches/safari-612-branch/Source/WebCore/platform/ios/WebAVPlayerController.mm	2021-09-23 20:30:13 UTC (rev 283004)
+++ branches/safari-612-branch/Source/WebCore/platform/ios/WebAVPlayerController.mm	2021-09-23 20:42:04 UTC (rev 283005)
@@ -173,7 +173,9 @@
     if (defaultPlaybackRate == _defaultPlaybackRate)
         return;
 
+    [self willChangeValueForKey:@"defaultPlaybackRate"];
     _defaultPlaybackRate = defaultPlaybackRate;
+    [self didChangeValueForKey:@"defaultPlaybackRate"];
 
     if (!fromJavaScript && self.delegate && self.delegate->defaultPlaybackRate() != _defaultPlaybackRate)
         self.delegate->setDefaultPlaybackRate(_defaultPlaybackRate);
@@ -197,7 +199,9 @@
     if (rate == _rate)
         return;
 
+    [self willChangeValueForKey:@"rate"];
     _rate = rate;
+    [self didChangeValueForKey:@"rate"];
 
     // AVKit doesn't have a separate variable for "paused", instead representing it by a `rate` of
     // `0`. Unfortunately, `HTMLMediaElement::play` doesn't call `HTMLMediaElement::setPlaybackRate`
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to