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

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

Issue 562493003: Allow seeks to zero on streaming sources. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 3 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 | « no previous file | Source/core/html/TimeRanges.cpp » ('j') | Source/core/html/TimeRangesTest.cpp » ('J')
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 2a8bc6b446321e6740ccabdf0c2f7afa8509fcaa..fd3ad9414b2adb72efddd4f52360c1b04b79c1a0 100644
--- a/Source/core/html/HTMLMediaElement.cpp
+++ b/Source/core/html/HTMLMediaElement.cpp
@@ -3228,6 +3228,17 @@ PassRefPtrWillBeRawPtr<TimeRanges> HTMLMediaElement::seekable() const
double maxTimeSeekable = webMediaPlayer()->maxTimeSeekable();
if (maxTimeSeekable)
return TimeRanges::create(0, maxTimeSeekable);
+ }
philipj_slow 2014/09/10 12:51:18 Doesn't compile ;)
DaleCurtis 2014/09/10 17:45:18 Heh, whoops, must have hit CtrlZ once too many bef
+
+ // For non-streaming media, emulate a seekable range around zero so looping works.
philipj_slow 2014/09/10 12:51:18 I don't think this is fixing the problem at the ap
acolwell GONE FROM CHROMIUM 2014/09/10 17:38:43 But we don't want to advertise that we can actuall
philipj_slow 2014/09/10 18:42:10 Oh, is a streaming cache used for non-seekable HTT
DaleCurtis 2014/09/10 18:56:49 Some are cached, some may not be depending on flag
+
+ if (duration() != std::numeric_limits<double>::infinity()) {
+ RefPtrWillBeRawPtr<TimeRanges> ranges = TimeRanges::create();
+ double now = webMediaPlayer()->currentTime();
+ ranges->add(0, std::numeric_limits<double>::epsilon());
+ ranges->add(now, now + std::numeric_limits<double>::epsilon());
acolwell GONE FROM CHROMIUM 2014/09/10 17:38:43 Have you tested this with https://codereview.chrom
DaleCurtis 2014/09/10 17:45:18 I haven't, but that CL just removes the noSeekRequ
acolwell GONE FROM CHROMIUM 2014/09/10 18:33:19 You only need the [0,epsilon) range for loop to wo
acolwell GONE FROM CHROMIUM 2014/09/10 18:41:05 Oh right. I didn't happen to notice that the neare
DaleCurtis 2014/09/10 18:56:49 Ah I thought you were asking to remove all ranges,
+ return ranges;
+ }
}
return TimeRanges::create();
}
« no previous file with comments | « no previous file | Source/core/html/TimeRanges.cpp » ('j') | Source/core/html/TimeRangesTest.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698