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

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

Issue 580093005: Fix the loop behavior on android (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 | « content/renderer/media/android/webmediaplayer_android.h ('k') | 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 27e2c1d8e698bd11d66049ff033363b72e5f3011..ae763db70973841e762bd9d52336a8798a96b17d 100644
--- a/content/renderer/media/android/webmediaplayer_android.cc
+++ b/content/renderer/media/android/webmediaplayer_android.cc
@@ -143,7 +143,6 @@ WebMediaPlayerAndroid::WebMediaPlayerAndroid(
needs_external_surface_(false),
has_valid_metadata_(false),
video_frame_provider_client_(NULL),
- pending_playback_(false),
player_type_(MEDIA_PLAYER_TYPE_URL),
is_remote_(false),
media_log_(media_log),
@@ -773,14 +772,11 @@ void WebMediaPlayerAndroid::OnPlaybackComplete() {
interpolator_.SetBounds(duration_, duration_);
client_->timeChanged();
- // if the loop attribute is set, timeChanged() will update the current time
- // to 0. It will perform a seek to 0. As the requests to the renderer
- // 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.
- UpdatePlayingState(false);
+ // If the loop attribute is set, timeChanged() will update the current time
+ // to 0. It will perform a seek to 0. Issue a command to the player to start
+ // playing after seek completes.
if (seeking_ && seek_time_ == base::TimeDelta())
- pending_playback_ = true;
+ player_manager_->Start(player_id_);
DaleCurtis 2014/09/18 18:15:33 Isn't the player already started?
qinmin 2014/09/18 18:21:21 when android mediaplayer reaches the end, it will
DaleCurtis 2014/09/18 18:23:33 Is it okay to do this before the seek completes?
}
void WebMediaPlayerAndroid::OnBufferingUpdate(int percentage) {
@@ -807,11 +803,6 @@ void WebMediaPlayerAndroid::OnSeekComplete(
UpdateReadyState(WebMediaPlayer::ReadyStateHaveEnoughData);
client_->timeChanged();
-
- if (pending_playback_) {
- play();
- pending_playback_ = false;
- }
}
void WebMediaPlayerAndroid::OnMediaError(int error_type) {
« no previous file with comments | « content/renderer/media/android/webmediaplayer_android.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698