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

Unified Diff: webkit/glue/webmediaplayer_impl.cc

Issue 334002: Use a saved copy of the time when pausing media elements. (Closed)
Patch Set: Created 11 years, 2 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 7e551b95a0d56b49e811df447da442b0109e4889..12bf8b8cb895c666adb043cc00a1e42335f9d302 100644
--- a/webkit/glue/webmediaplayer_impl.cc
+++ b/webkit/glue/webmediaplayer_impl.cc
@@ -260,6 +260,7 @@ void WebMediaPlayerImpl::pause() {
paused_ = true;
pipeline_->SetPlaybackRate(0.0f);
+ paused_time_ = pipeline_->GetCurrentTime();
}
bool WebMediaPlayerImpl::supportsFullscreen() const {
@@ -398,6 +399,9 @@ float WebMediaPlayerImpl::duration() const {
float WebMediaPlayerImpl::currentTime() const {
DCHECK(MessageLoop::current() == main_loop_);
+ if (paused_) {
+ return static_cast<float>(paused_time_.InSecondsF());
+ }
return static_cast<float>(pipeline_->GetCurrentTime().InSecondsF());
}
« 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