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

Unified Diff: Source/core/html/shadow/MediaControlElements.cpp

Issue 614263002: Drop all timeline seeks outside of the seekable range. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@seek
Patch Set: Rebase. Test. Created 6 years, 2 months 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/http/tests/media/audio-timeline-seek-outside-seekable.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/shadow/MediaControlElements.cpp
diff --git a/Source/core/html/shadow/MediaControlElements.cpp b/Source/core/html/shadow/MediaControlElements.cpp
index 2439bb62e1be659462f2a824b329da9646fcf7fd..ecf407457684f156fd0e13da09c8e0dd43139111 100644
--- a/Source/core/html/shadow/MediaControlElements.cpp
+++ b/Source/core/html/shadow/MediaControlElements.cpp
@@ -37,6 +37,7 @@
#include "core/frame/LocalFrame.h"
#include "core/html/HTMLVideoElement.h"
#include "core/html/MediaController.h"
+#include "core/html/TimeRanges.h"
#include "core/html/shadow/MediaControls.h"
#include "core/html/track/TextTrack.h"
#include "core/html/track/vtt/VTTRegionList.h"
@@ -418,10 +419,12 @@ void MediaControlTimelineElement::defaultEventHandler(Event* event)
if (event->type() == EventTypeNames::input) {
// FIXME: This will need to take the timeline offset into consideration
// once that concept is supported, see https://crbug.com/312699
- if (mediaElement().controller())
- mediaElement().controller()->setCurrentTime(time);
- else
+ if (mediaElement().controller()) {
+ if (mediaElement().controller()->seekable()->contain(time))
+ mediaElement().controller()->setCurrentTime(time);
+ } else if (mediaElement().seekable()->contain(time)) {
mediaElement().setCurrentTime(time, IGNORE_EXCEPTION);
+ }
}
RenderSlider* slider = toRenderSlider(renderer());
« no previous file with comments | « LayoutTests/http/tests/media/audio-timeline-seek-outside-seekable.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698