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

Unified Diff: webkit/glue/webmediaplayer_impl.cc

Issue 2085012: Reporting a more accurate buffered time for the video tag (Closed)
Patch Set: Added checks to fix some edgecase bugs. Created 10 years, 6 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..77dc094826b793b2995c6a75aa2db93d2e9218a7 100644
--- a/webkit/glue/webmediaplayer_impl.cc
+++ b/webkit/glue/webmediaplayer_impl.cc
@@ -446,6 +446,20 @@ const WebKit::WebTimeRanges& WebMediaPlayerImpl::buffered() const {
return buffered_;
}
+const WebKit::WebTimeRanges& WebMediaPlayerImpl::buffered() {
+ DCHECK(MessageLoop::current() == main_loop_);
+
+ // Update buffered_ with the most recent buffered time.
+ if (buffered_.size() > 0) {
+ float buffered_time = static_cast<float>(
+ pipeline_->GetBufferedTime().InSecondsF());
+ if (buffered_time >= buffered_[0].start)
+ buffered_[0].end = buffered_time;
+ }
+
+ 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