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

Unified Diff: content/renderer/media/android/webmediaplayer_android.cc

Issue 557363004: Fix incorrect set of playing state in WebMediaPlayerAndroid. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix other bugs. Created 6 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/media/android/webmediaplayer_android.cc
diff --git a/content/renderer/media/android/webmediaplayer_android.cc b/content/renderer/media/android/webmediaplayer_android.cc
index 4bb016233a36016c2ab746b12df489db162da957..8a5b76b96ecc9db3eb0fc74b46d51f0ffe1565a4 100644
--- a/content/renderer/media/android/webmediaplayer_android.cc
+++ b/content/renderer/media/android/webmediaplayer_android.cc
@@ -766,7 +766,7 @@ void WebMediaPlayerAndroid::OnPlaybackComplete() {
// process are sequential, the OnSeekComplete() will only occur
// once OnPlaybackComplete() is done. As the playback can only be executed
// upon completion of OnSeekComplete(), the request needs to be saved.
- is_playing_ = false;
+ UpdatePlayingState(false);
qinmin 2014/09/16 17:28:24 you can just remove this statement, it does nothin
DaleCurtis 2014/09/16 17:30:27 I'm not sure about that. If the element is set to
if (seeking_ && seek_time_ == base::TimeDelta())
pending_playback_ = true;
}
@@ -1308,18 +1308,22 @@ void WebMediaPlayerAndroid::setPoster(const blink::WebURL& poster) {
}
void WebMediaPlayerAndroid::UpdatePlayingState(bool is_playing) {
- const bool was_playing = is_playing_;
- is_playing_ = is_playing;
- if (!delegate_ || was_playing == is_playing_)
+ if (is_playing == is_playing_)
return;
+
+ is_playing_ = is_playing;
+
if (is_playing)
interpolator_.StartInterpolating();
else
interpolator_.StopInterpolating();
- if (is_playing)
- delegate_->DidPlay(this);
- else
- delegate_->DidPause(this);
+
+ if (delegate_) {
qinmin 2014/09/16 17:28:24 Thanks for fixing my mistake here. I remember i pu
+ if (is_playing)
+ delegate_->DidPlay(this);
+ else
+ delegate_->DidPause(this);
+ }
}
#if defined(VIDEO_HOLE)
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698