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

Unified Diff: media/blink/webmediaplayer_impl.cc

Issue 1415683009: Support earliest seekable time in WMPI. Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: more androidfixes. Created 5 years, 1 month 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 | « media/blink/webmediaplayer_impl.h ('k') | third_party/WebKit/Source/core/html/HTMLMediaElement.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/blink/webmediaplayer_impl.cc
diff --git a/media/blink/webmediaplayer_impl.cc b/media/blink/webmediaplayer_impl.cc
index 5be9452d38f572d1cd0acb5b9da0f1a7499771ce..e10420a9cc3da976cb6a393836d9f02c55c6d50f 100644
--- a/media/blink/webmediaplayer_impl.cc
+++ b/media/blink/webmediaplayer_impl.cc
@@ -488,6 +488,10 @@ bool WebMediaPlayerImpl::seeking() const {
return seeking_;
}
+double WebMediaPlayerImpl::earliestTime() const {
+ return pipeline_.GetMediaStartTime().InSecondsF();
+}
+
double WebMediaPlayerImpl::duration() const {
DCHECK(main_task_runner_->BelongsToCurrentThread());
@@ -556,6 +560,7 @@ blink::WebTimeRanges WebMediaPlayerImpl::seekable() const {
if (ready_state_ < WebMediaPlayer::ReadyStateHaveMetadata)
return blink::WebTimeRanges();
+ const double seekable_start = pipeline_.GetMediaStartTime().InSecondsF();
const double seekable_end = duration();
// Allow a special exception for seeks to zero for streaming sources with a
@@ -567,7 +572,8 @@ blink::WebTimeRanges WebMediaPlayerImpl::seekable() const {
// infinite duration so long as DataSource::IsStreaming() is false. While not
// expected, disabling this breaks semi-live players, http://crbug.com/427412.
const blink::WebTimeRange seekable_range(
- 0.0, allow_seek_to_zero ? 0.0 : seekable_end);
+ allow_seek_to_zero ? 0.0 : seekable_start,
+ allow_seek_to_zero ? 0.0 : seekable_end);
return blink::WebTimeRanges(&seekable_range, 1);
}
« no previous file with comments | « media/blink/webmediaplayer_impl.h ('k') | third_party/WebKit/Source/core/html/HTMLMediaElement.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698