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

Unified Diff: webkit/glue/webmediaplayer_impl.cc

Issue 2192001: Reporting a more accurate buffered time for the video tag (Closed)
Patch Set: Created 10 years, 7 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 | « webkit/glue/webmediaplayer_impl.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/glue/webmediaplayer_impl.cc
diff --git a/webkit/glue/webmediaplayer_impl.cc b/webkit/glue/webmediaplayer_impl.cc
index f066cc7c8e125f9e4d8a4397959d9200301b975d..0157c80c2709c1fcf2f07388714f2d0175472a11 100644
--- a/webkit/glue/webmediaplayer_impl.cc
+++ b/webkit/glue/webmediaplayer_impl.cc
@@ -440,12 +440,23 @@ int WebMediaPlayerImpl::dataRate() const {
return 0;
}
+// This will be deleted once the WebKit::WebMediaPlayer interface is updated.
const WebKit::WebTimeRanges& WebMediaPlayerImpl::buffered() const {
DCHECK(MessageLoop::current() == main_loop_);
return buffered_;
}
+const WebKit::WebTimeRanges& WebMediaPlayerImpl::buffered() {
+ DCHECK(MessageLoop::current() == main_loop_);
+
+ // Update buffered_ with the most recent buffered time.
+ buffered_[0].end = static_cast<float>(
+ pipeline_->GetBufferedTime().InSecondsF());
+
+ return buffered_;
+}
+
float WebMediaPlayerImpl::maxTimeSeekable() const {
DCHECK(MessageLoop::current() == main_loop_);
« no previous file with comments | « webkit/glue/webmediaplayer_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698