[iOS] Don't update AVPlayerViewController currentTime while scrubbing
authoreric.carlson@apple.com <eric.carlson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 7 Dec 2018 18:08:24 +0000 (18:08 +0000)
committereric.carlson@apple.com <eric.carlson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 7 Dec 2018 18:08:24 +0000 (18:08 +0000)
https://bugs.webkit.org/show_bug.cgi?id=192438
<rdar://problem/42977046>

Reviewed by Jer Noble.

No new tests, tested manually.

* platform/ios/PlaybackSessionInterfaceAVKit.mm:
(WebCore::PlaybackSessionInterfaceAVKit::currentTimeChanged): Don't report change during scrubbing.

* platform/ios/WebAVPlayerController.h:
* platform/ios/WebAVPlayerController.mm:
(-[WebAVPlayerController beginScrubbing:]): Set _isScrubbing.
(-[WebAVPlayerController endScrubbing:]): Ditto.
(-[WebAVPlayerController isScrubbing]): Return _isScrubbing.

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

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

index cfd3fe4..a0ededd 100644 (file)
@@ -1,3 +1,22 @@
+2018-12-07  Eric Carlson  <eric.carlson@apple.com>
+
+        [iOS] Don't update AVPlayerViewController currentTime while scrubbing
+        https://bugs.webkit.org/show_bug.cgi?id=192438
+        <rdar://problem/42977046>
+
+        Reviewed by Jer Noble.
+
+        No new tests, tested manually.
+
+        * platform/ios/PlaybackSessionInterfaceAVKit.mm:
+        (WebCore::PlaybackSessionInterfaceAVKit::currentTimeChanged): Don't report change during scrubbing.
+
+        * platform/ios/WebAVPlayerController.h:
+        * platform/ios/WebAVPlayerController.mm:
+        (-[WebAVPlayerController beginScrubbing:]): Set _isScrubbing.
+        (-[WebAVPlayerController endScrubbing:]): Ditto.
+        (-[WebAVPlayerController isScrubbing]): Return _isScrubbing.
+
 2018-12-07  Thibault Saunier  <tsaunier@igalia.com>
 
         [WPE][GTK] Implement WebAudioSourceProviderGStreamer to allow bridging MediaStream and the WebAudio APIs
 2018-12-07  Thibault Saunier  <tsaunier@igalia.com>
 
         [WPE][GTK] Implement WebAudioSourceProviderGStreamer to allow bridging MediaStream and the WebAudio APIs
index ccbb0c4..e2b4258 100644 (file)
@@ -95,6 +95,9 @@ void PlaybackSessionInterfaceAVKit::durationChanged(double duration)
 
 void PlaybackSessionInterfaceAVKit::currentTimeChanged(double currentTime, double anchorTime)
 {
 
 void PlaybackSessionInterfaceAVKit::currentTimeChanged(double currentTime, double anchorTime)
 {
+    if ([m_playerController isScrubbing])
+        return;
+
     NSTimeInterval anchorTimeStamp = ![m_playerController rate] ? NAN : anchorTime;
     AVValueTiming *timing = [getAVValueTimingClass() valueTimingWithAnchorValue:currentTime
         anchorTimeStamp:anchorTimeStamp rate:0];
     NSTimeInterval anchorTimeStamp = ![m_playerController rate] ? NAN : anchorTime;
     AVValueTiming *timing = [getAVValueTimingClass() valueTimingWithAnchorValue:currentTime
         anchorTimeStamp:anchorTimeStamp rate:0];
index c080828..a639a98 100644 (file)
@@ -51,6 +51,7 @@ class PlaybackSessionInterfaceAVKit;
 @property BOOL canScanBackward;
 @property (readonly) BOOL canSeekToBeginning;
 @property (readonly) BOOL canSeekToEnd;
 @property BOOL canScanBackward;
 @property (readonly) BOOL canSeekToBeginning;
 @property (readonly) BOOL canSeekToEnd;
+@property (readonly) BOOL isScrubbing;
 
 @property BOOL canPlay;
 @property (getter=isPlaying) BOOL playing;
 
 @property BOOL canPlay;
 @property (getter=isPlaying) BOOL playing;
index 4399bfd..ab5562d 100644 (file)
@@ -56,6 +56,7 @@ static double WebAVPlayerControllerLiveStreamSeekableTimeRangeMinimumDuration =
 
 @implementation WebAVPlayerController {
     BOOL _liveStreamEventModePossible;
 
 @implementation WebAVPlayerController {
     BOOL _liveStreamEventModePossible;
+    BOOL _isScrubbing;
 }
 
 - (instancetype)init
 }
 
 - (instancetype)init
@@ -157,6 +158,7 @@ static double WebAVPlayerControllerLiveStreamSeekableTimeRangeMinimumDuration =
 - (void)beginScrubbing:(id)sender
 {
     UNUSED_PARAM(sender);
 - (void)beginScrubbing:(id)sender
 {
     UNUSED_PARAM(sender);
+    _isScrubbing = YES;
     if (self.delegate)
         self.delegate->beginScrubbing();
 }
     if (self.delegate)
         self.delegate->beginScrubbing();
 }
@@ -164,6 +166,7 @@ static double WebAVPlayerControllerLiveStreamSeekableTimeRangeMinimumDuration =
 - (void)endScrubbing:(id)sender
 {
     UNUSED_PARAM(sender);
 - (void)endScrubbing:(id)sender
 {
     UNUSED_PARAM(sender);
+    _isScrubbing = NO;
     if (self.delegate)
         self.delegate->endScrubbing();
 }
     if (self.delegate)
         self.delegate->endScrubbing();
 }
@@ -288,6 +291,11 @@ static double WebAVPlayerControllerLiveStreamSeekableTimeRangeMinimumDuration =
         [self seekToTime:timeAtEndOfSeekableTimeRanges];
 }
 
         [self seekToTime:timeAtEndOfSeekableTimeRanges];
 }
 
+- (BOOL)isScrubbing
+{
+    return _isScrubbing;
+}
+
 - (BOOL)canScanForward
 {
     return [self canPlay];
 - (BOOL)canScanForward
 {
     return [self canPlay];