Diff
Modified: trunk/Source/WebCore/ChangeLog (224084 => 224085)
--- trunk/Source/WebCore/ChangeLog 2017-10-27 04:04:18 UTC (rev 224084)
+++ trunk/Source/WebCore/ChangeLog 2017-10-27 06:06:38 UTC (rev 224085)
@@ -1,3 +1,30 @@
+2017-10-26 Jeremy Jones <[email protected]>
+
+ Implement seek tolerance methods in WebAVPlayerController.
+ https://bugs.webkit.org/show_bug.cgi?id=178838
+ rdar://problem/33781777
+
+ Reviewed by Eric Carlson.
+
+ No new tests because this doesn't change any behavior in the page, but exposes seek tolerance to fullscreen platform UI.
+
+ * html/HTMLMediaElement.cpp:
+ (WebCore::HTMLMediaElement::setCurrentTimeWithTolerance):
+ * html/HTMLMediaElement.h:
+ * platform/cocoa/PlaybackSessionModel.h:
+ * platform/cocoa/PlaybackSessionModelMediaElement.h:
+ * platform/cocoa/PlaybackSessionModelMediaElement.mm:
+ (WebCore::PlaybackSessionModelMediaElement::seekToTime):
+ * platform/ios/WebAVPlayerController.mm:
+ (-[WebAVPlayerController seekToTime:]):
+ (-[WebAVPlayerController seekToTime:toleranceBefore:toleranceAfter:]):
+ (-[WebAVPlayerController seekByTimeInterval:]):
+ (-[WebAVPlayerController seekByTimeInterval:toleranceBefore:toleranceAfter:]):
+ (-[WebAVPlayerController seekToBeginning:]):
+ (-[WebAVPlayerController seekToEnd:]):
+ * platform/ios/WebVideoFullscreenControllerAVKit.mm:
+ (VideoFullscreenControllerContext::seekToTime):
+
2017-10-26 Michael Catanzaro <[email protected]>
Unreviewed, fix WPE build after r224074
Modified: trunk/Source/WebCore/html/HTMLMediaElement.cpp (224084 => 224085)
--- trunk/Source/WebCore/html/HTMLMediaElement.cpp 2017-10-27 04:04:18 UTC (rev 224084)
+++ trunk/Source/WebCore/html/HTMLMediaElement.cpp 2017-10-27 06:06:38 UTC (rev 224085)
@@ -3142,6 +3142,11 @@
setCurrentTime(MediaTime::createWithDouble(time));
}
+void HTMLMediaElement::setCurrentTimeWithTolerance(double time, double toleranceBefore, double toleranceAfter)
+{
+ seekWithTolerance(MediaTime::createWithDouble(time), MediaTime::createWithDouble(toleranceBefore), MediaTime::createWithDouble(toleranceAfter), true);
+}
+
void HTMLMediaElement::setCurrentTime(const MediaTime& time)
{
if (m_mediaController)
Modified: trunk/Source/WebCore/html/HTMLMediaElement.h (224084 => 224085)
--- trunk/Source/WebCore/html/HTMLMediaElement.h 2017-10-27 04:04:18 UTC (rev 224084)
+++ trunk/Source/WebCore/html/HTMLMediaElement.h 2017-10-27 06:06:38 UTC (rev 224085)
@@ -226,6 +226,7 @@
// playback state
WEBCORE_EXPORT double currentTime() const override;
void setCurrentTime(double) override;
+ void setCurrentTimeWithTolerance(double, double toleranceBefore, double toleranceAfter);
double currentTimeForBindings() const { return currentTime(); }
WEBCORE_EXPORT ExceptionOr<void> setCurrentTimeForBindings(double);
WEBCORE_EXPORT double getStartDate() const;
Modified: trunk/Source/WebCore/platform/cocoa/PlaybackSessionModel.h (224084 => 224085)
--- trunk/Source/WebCore/platform/cocoa/PlaybackSessionModel.h 2017-10-27 04:04:18 UTC (rev 224084)
+++ trunk/Source/WebCore/platform/cocoa/PlaybackSessionModel.h 2017-10-27 06:06:38 UTC (rev 224085)
@@ -48,7 +48,7 @@
virtual void togglePlayState() = 0;
virtual void beginScrubbing() = 0;
virtual void endScrubbing() = 0;
- virtual void seekToTime(double time) = 0;
+ virtual void seekToTime(double time, double toleranceBefore = 0, double toleranceAfter = 0) = 0;
virtual void fastSeek(double time) = 0;
virtual void beginScanningForward() = 0;
virtual void beginScanningBackward() = 0;
Modified: trunk/Source/WebCore/platform/cocoa/PlaybackSessionModelMediaElement.h (224084 => 224085)
--- trunk/Source/WebCore/platform/cocoa/PlaybackSessionModelMediaElement.h 2017-10-27 04:04:18 UTC (rev 224084)
+++ trunk/Source/WebCore/platform/cocoa/PlaybackSessionModelMediaElement.h 2017-10-27 06:06:38 UTC (rev 224085)
@@ -62,7 +62,7 @@
WEBCORE_EXPORT void togglePlayState() final;
WEBCORE_EXPORT void beginScrubbing() final;
WEBCORE_EXPORT void endScrubbing() final;
- WEBCORE_EXPORT void seekToTime(double time) final;
+ WEBCORE_EXPORT void seekToTime(double time, double toleranceBefore, double toleranceAfter) final;
WEBCORE_EXPORT void fastSeek(double time) final;
WEBCORE_EXPORT void beginScanningForward() final;
WEBCORE_EXPORT void beginScanningBackward() final;
Modified: trunk/Source/WebCore/platform/cocoa/PlaybackSessionModelMediaElement.mm (224084 => 224085)
--- trunk/Source/WebCore/platform/cocoa/PlaybackSessionModelMediaElement.mm 2017-10-27 04:04:18 UTC (rev 224084)
+++ trunk/Source/WebCore/platform/cocoa/PlaybackSessionModelMediaElement.mm 2017-10-27 06:06:38 UTC (rev 224085)
@@ -218,10 +218,10 @@
m_mediaElement->endScrubbing();
}
-void PlaybackSessionModelMediaElement::seekToTime(double time)
+void PlaybackSessionModelMediaElement::seekToTime(double time, double toleranceBefore, double toleranceAfter)
{
if (m_mediaElement)
- m_mediaElement->setCurrentTime(time);
+ m_mediaElement->setCurrentTimeWithTolerance(time, toleranceBefore, toleranceAfter);
}
void PlaybackSessionModelMediaElement::fastSeek(double time)
Modified: trunk/Source/WebCore/platform/ios/WebAVPlayerController.mm (224084 => 224085)
--- trunk/Source/WebCore/platform/ios/WebAVPlayerController.mm 2017-10-27 04:04:18 UTC (rev 224084)
+++ trunk/Source/WebCore/platform/ios/WebAVPlayerController.mm 2017-10-27 06:06:38 UTC (rev 224085)
@@ -167,9 +167,25 @@
- (void)seekToTime:(NSTimeInterval)time
{
if (self.delegate)
- self.delegate->fastSeek(time);
+ self.delegate->seekToTime(time);
}
+- (void)seekToTime:(NSTimeInterval)time toleranceBefore:(NSTimeInterval)before toleranceAfter:(NSTimeInterval)after
+{
+ self.delegate->seekToTime(time, before, after);
+}
+
+- (void)seekByTimeInterval:(NSTimeInterval)interval
+{
+ [self seekByTimeInterval:interval toleranceBefore:0. toleranceAfter:0.];
+}
+
+- (void)seekByTimeInterval:(NSTimeInterval)interval toleranceBefore:(NSTimeInterval)before toleranceAfter:(NSTimeInterval)after
+{
+ NSTimeInterval targetTime = [[self timing] currentValue] + interval;
+ [self seekToTime:targetTime toleranceBefore:before toleranceAfter:after];
+}
+
- (NSTimeInterval)currentTimeWithinEndTimes
{
return self.timing.currentValue;
Modified: trunk/Source/WebCore/platform/ios/WebVideoFullscreenControllerAVKit.mm (224084 => 224085)
--- trunk/Source/WebCore/platform/ios/WebVideoFullscreenControllerAVKit.mm 2017-10-27 04:04:18 UTC (rev 224084)
+++ trunk/Source/WebCore/platform/ios/WebVideoFullscreenControllerAVKit.mm 2017-10-27 06:06:38 UTC (rev 224085)
@@ -140,7 +140,7 @@
void togglePlayState() override;
void beginScrubbing() override;
void endScrubbing() override;
- void seekToTime(double) override;
+ void seekToTime(double, double, double) override;
void fastSeek(double time) override;
void beginScanningForward() override;
void beginScanningBackward() override;
@@ -635,13 +635,13 @@
});
}
-void VideoFullscreenControllerContext::seekToTime(double time)
+void VideoFullscreenControllerContext::seekToTime(double time, double toleranceBefore, double toleranceAfter)
{
ASSERT(isUIThread());
RefPtr<VideoFullscreenControllerContext> protectedThis(this);
- WebThreadRun([protectedThis, this, time] {
+ WebThreadRun([protectedThis, this, time, toleranceBefore, toleranceAfter] {
if (m_playbackModel)
- m_playbackModel->seekToTime(time);
+ m_playbackModel->seekToTime(time, toleranceBefore, toleranceAfter);
});
}
Modified: trunk/Source/WebKit/ChangeLog (224084 => 224085)
--- trunk/Source/WebKit/ChangeLog 2017-10-27 04:04:18 UTC (rev 224084)
+++ trunk/Source/WebKit/ChangeLog 2017-10-27 06:06:38 UTC (rev 224085)
@@ -1,3 +1,22 @@
+2017-10-26 Jeremy Jones <[email protected]>
+
+ Implement seek tolerance methods in WebAVPlayerController.
+ https://bugs.webkit.org/show_bug.cgi?id=178838
+ rdar://problem/33781777
+
+ Reviewed by Eric Carlson.
+
+ This implementes additional methods on WebAVPlayerController that allows AVKit more control over seeking.
+
+ * UIProcess/Cocoa/PlaybackSessionManagerProxy.h:
+ * UIProcess/Cocoa/PlaybackSessionManagerProxy.mm:
+ (WebKit::PlaybackSessionModelContext::seekToTime):
+ (WebKit::PlaybackSessionManagerProxy::seekToTime):
+ * WebProcess/cocoa/PlaybackSessionManager.h:
+ * WebProcess/cocoa/PlaybackSessionManager.messages.in:
+ * WebProcess/cocoa/PlaybackSessionManager.mm:
+ (WebKit::PlaybackSessionManager::seekToTime):
+
2017-10-26 Brian Burg <[email protected]>
Web Automation: denying user permission for getUserMedia doesn't work
Modified: trunk/Source/WebKit/UIProcess/Cocoa/PlaybackSessionManagerProxy.h (224084 => 224085)
--- trunk/Source/WebKit/UIProcess/Cocoa/PlaybackSessionManagerProxy.h 2017-10-27 04:04:18 UTC (rev 224084)
+++ trunk/Source/WebKit/UIProcess/Cocoa/PlaybackSessionManagerProxy.h 2017-10-27 06:06:38 UTC (rev 224085)
@@ -100,7 +100,7 @@
void togglePlayState() final;
void beginScrubbing() final;
void endScrubbing() final;
- void seekToTime(double) final;
+ void seekToTime(double, double, double) final;
void fastSeek(double time) final;
void beginScanningForward() final;
void beginScanningBackward() final;
@@ -209,7 +209,7 @@
void togglePlayState(uint64_t contextId);
void beginScrubbing(uint64_t contextId);
void endScrubbing(uint64_t contextId);
- void seekToTime(uint64_t contextId, double time);
+ void seekToTime(uint64_t contextId, double time, double before, double after);
void fastSeek(uint64_t contextId, double time);
void beginScanningForward(uint64_t contextId);
void beginScanningBackward(uint64_t contextId);
Modified: trunk/Source/WebKit/UIProcess/Cocoa/PlaybackSessionManagerProxy.mm (224084 => 224085)
--- trunk/Source/WebKit/UIProcess/Cocoa/PlaybackSessionManagerProxy.mm 2017-10-27 04:04:18 UTC (rev 224084)
+++ trunk/Source/WebKit/UIProcess/Cocoa/PlaybackSessionManagerProxy.mm 2017-10-27 06:06:38 UTC (rev 224085)
@@ -86,10 +86,10 @@
m_playbackStartedTimeNeedsUpdate = isPlaying();
}
-void PlaybackSessionModelContext::seekToTime(double time)
+void PlaybackSessionModelContext::seekToTime(double time, double toleranceBefore, double toleranceAfter)
{
if (m_manager)
- m_manager->seekToTime(m_contextId, time);
+ m_manager->seekToTime(m_contextId, time, toleranceBefore, toleranceAfter);
}
void PlaybackSessionModelContext::fastSeek(double time)
@@ -494,9 +494,9 @@
m_page->send(Messages::PlaybackSessionManager::EndScrubbing(contextId), m_page->pageID());
}
-void PlaybackSessionManagerProxy::seekToTime(uint64_t contextId, double time)
+void PlaybackSessionManagerProxy::seekToTime(uint64_t contextId, double time, double toleranceBefore, double toleranceAfter)
{
- m_page->send(Messages::PlaybackSessionManager::SeekToTime(contextId, time), m_page->pageID());
+ m_page->send(Messages::PlaybackSessionManager::SeekToTime(contextId, time, toleranceBefore, toleranceAfter), m_page->pageID());
}
void PlaybackSessionManagerProxy::fastSeek(uint64_t contextId, double time)
Modified: trunk/Source/WebKit/WebProcess/cocoa/PlaybackSessionManager.h (224084 => 224085)
--- trunk/Source/WebKit/WebProcess/cocoa/PlaybackSessionManager.h 2017-10-27 04:04:18 UTC (rev 224084)
+++ trunk/Source/WebKit/WebProcess/cocoa/PlaybackSessionManager.h 2017-10-27 06:06:38 UTC (rev 224085)
@@ -146,7 +146,7 @@
void togglePlayState(uint64_t contextId);
void beginScrubbing(uint64_t contextId);
void endScrubbing(uint64_t contextId);
- void seekToTime(uint64_t contextId, double time);
+ void seekToTime(uint64_t contextId, double time, double toleranceBefore, double toleranceAfter);
void fastSeek(uint64_t contextId, double time);
void beginScanningForward(uint64_t contextId);
void beginScanningBackward(uint64_t contextId);
Modified: trunk/Source/WebKit/WebProcess/cocoa/PlaybackSessionManager.messages.in (224084 => 224085)
--- trunk/Source/WebKit/WebProcess/cocoa/PlaybackSessionManager.messages.in 2017-10-27 04:04:18 UTC (rev 224084)
+++ trunk/Source/WebKit/WebProcess/cocoa/PlaybackSessionManager.messages.in 2017-10-27 06:06:38 UTC (rev 224085)
@@ -28,7 +28,7 @@
TogglePlayState(uint64_t contextId)
BeginScrubbing(uint64_t contextId)
EndScrubbing(uint64_t contextId)
- SeekToTime(uint64_t contextId, double time)
+ SeekToTime(uint64_t contextId, double time, double toleranceBefore, double toleranceAfter)
FastSeek(uint64_t contextId, double time)
BeginScanningForward(uint64_t contextId)
BeginScanningBackward(uint64_t contextId)
Modified: trunk/Source/WebKit/WebProcess/cocoa/PlaybackSessionManager.mm (224084 => 224085)
--- trunk/Source/WebKit/WebProcess/cocoa/PlaybackSessionManager.mm 2017-10-27 04:04:18 UTC (rev 224084)
+++ trunk/Source/WebKit/WebProcess/cocoa/PlaybackSessionManager.mm 2017-10-27 06:06:38 UTC (rev 224085)
@@ -409,10 +409,10 @@
ensureModel(contextId).endScrubbing();
}
-void PlaybackSessionManager::seekToTime(uint64_t contextId, double time)
+void PlaybackSessionManager::seekToTime(uint64_t contextId, double time, double toleranceBefore, double toleranceAfter)
{
UserGestureIndicator indicator(ProcessingUserGesture);
- ensureModel(contextId).seekToTime(time);
+ ensureModel(contextId).seekToTime(time, toleranceBefore, toleranceAfter);
}
void PlaybackSessionManager::fastSeek(uint64_t contextId, double time)