Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(464)

Unified Diff: Source/core/html/HTMLMediaElement.cpp

Issue 456343002: Relanding 'Always notify the MediaPlayer of any seek' patch (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fixed LayoutTests/media/video-double-seek-currentTime.html failure Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « LayoutTests/media/video-seek-to-current-position-expected.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/HTMLMediaElement.cpp
diff --git a/Source/core/html/HTMLMediaElement.cpp b/Source/core/html/HTMLMediaElement.cpp
index 36e03dec0470a582d30d801aaac4e6b1e9333b52..2673c515102f3f7a407d32496fe9e4024e2b7925 100644
--- a/Source/core/html/HTMLMediaElement.cpp
+++ b/Source/core/html/HTMLMediaElement.cpp
@@ -1995,7 +1995,6 @@ void HTMLMediaElement::seek(double time)
// 4 - Set the seeking IDL attribute to true.
// The flag will be cleared when the engine tells us the time has actually changed.
- bool previousSeekStillPending = m_seeking;
m_seeking = true;
// 6 - If the new playback position is later than the end of the media resource, then let it be the end
@@ -2022,30 +2021,17 @@ void HTMLMediaElement::seek(double time)
// attribute then set the seeking IDL attribute to false and abort these steps.
RefPtrWillBeRawPtr<TimeRanges> seekableRanges = seekable();
- // Short circuit seeking to the current time by just firing the events if no seek is required.
- // Don't skip calling the media engine if we are in poster mode because a seek should always
- // cancel poster display.
- bool noSeekRequired = !seekableRanges->length() || (time == now && displayMode() != Poster);
-
- if (noSeekRequired) {
- if (time == now) {
- scheduleEvent(EventTypeNames::seeking);
- if (previousSeekStillPending)
- return;
- // FIXME: There must be a stable state before timeupdate+seeked are dispatched and seeking
- // is reset to false. See http://crbug.com/266631
- scheduleTimeupdateEvent(false);
- scheduleEvent(EventTypeNames::seeked);
- }
+ if (!seekableRanges->length()) {
m_seeking = false;
return;
}
time = seekableRanges->nearest(time, now);
+ if (webMediaPlayer()->seeking() && time == m_lastSeekTime)
philipj_slow 2014/12/19 15:06:03 I don't know, it seems odd that WebMediaPlayer::se
+ return;
+
+ if (m_playing && m_lastSeekTime < now)
+ addPlayedRange(m_lastSeekTime, now);
- if (m_playing) {
- if (m_lastSeekTime < now)
- addPlayedRange(m_lastSeekTime, now);
- }
m_lastSeekTime = time;
m_sentEndEvent = false;
« no previous file with comments | « LayoutTests/media/video-seek-to-current-position-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698