| Index: Source/core/html/HTMLMediaElement.cpp
|
| diff --git a/Source/core/html/HTMLMediaElement.cpp b/Source/core/html/HTMLMediaElement.cpp
|
| index 3de8b380eb9bfbbd0cf8922a62cc977d3314d733..b66d005d2036bb65fd77c490524267d19c0e3ea4 100644
|
| --- a/Source/core/html/HTMLMediaElement.cpp
|
| +++ b/Source/core/html/HTMLMediaElement.cpp
|
| @@ -1995,6 +1995,7 @@
|
|
|
| // 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
|
| @@ -2021,15 +2022,30 @@
|
| // attribute then set the seeking IDL attribute to false and abort these steps.
|
| RefPtrWillBeRawPtr<TimeRanges> seekableRanges = seekable();
|
|
|
| - if (!seekableRanges->length()) {
|
| + // 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);
|
| + }
|
| m_seeking = false;
|
| return;
|
| }
|
| time = seekableRanges->nearest(time, now);
|
|
|
| - 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;
|
|
|
|
|