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

Unified Diff: webkit/glue/webmediaplayer_impl.cc

Issue 199037: Buffered time ranges for <video> (Closed)
Patch Set: DEPS Created 11 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 | « 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 49d29e055479e21cf26cc29c9fc8e4683553c6ee..3b1b298e8462f8e1682323b7005b737d733521f3 100644
--- a/webkit/glue/webmediaplayer_impl.cc
+++ b/webkit/glue/webmediaplayer_impl.cc
@@ -368,7 +368,7 @@ bool WebMediaPlayerImpl::seeking() const {
if (ready_state_ == WebKit::WebMediaPlayer::HaveNothing)
return false;
-
+
return ready_state_ == WebKit::WebMediaPlayer::HaveMetadata;
}
@@ -391,10 +391,10 @@ int WebMediaPlayerImpl::dataRate() const {
return 0;
}
-float WebMediaPlayerImpl::maxTimeBuffered() const {
+const WebKit::WebTimeRanges& WebMediaPlayerImpl::buffered() const {
DCHECK(MessageLoop::current() == main_loop_);
- return static_cast<float>(pipeline_->GetBufferedTime().InSecondsF());
+ return buffered_;
}
float WebMediaPlayerImpl::maxTimeSeekable() const {
@@ -471,6 +471,12 @@ void WebMediaPlayerImpl::Repaint() {
void WebMediaPlayerImpl::OnPipelineInitialize() {
DCHECK(MessageLoop::current() == main_loop_);
if (pipeline_->GetError() == media::PIPELINE_OK) {
+ // Only keep one time range starting from 0.
+ buffered_.push_back(
+ WebKit::WebTimeRange(
+ 0.0f,
+ static_cast<float>(pipeline_->GetBufferedTime().InSecondsF())));
+
// Since we have initialized the pipeline, say we have everything.
// TODO(hclam): change this to report the correct status.
SetReadyState(WebKit::WebMediaPlayer::HaveMetadata);
« 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