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

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: rebase 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 47da91c5ec22cdae047748f41701d2d2452411af..3ef95f8ede6ffb7029ad3c4e281e4e3f474c55bd 100644
--- a/content/renderer/media/android/webmediaplayer_android.cc
+++ b/content/renderer/media/android/webmediaplayer_android.cc
@@ -142,7 +142,6 @@ WebMediaPlayerAndroid::WebMediaPlayerAndroid(
stream_texture_factory_(factory),
needs_external_surface_(false),
video_frame_provider_client_(NULL),
- pending_playback_(false),
player_type_(MEDIA_PLAYER_TYPE_URL),
is_remote_(false),
media_log_(media_log),
@@ -766,14 +765,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_);
}
void WebMediaPlayerAndroid::OnBufferingUpdate(int percentage) {
@@ -800,11 +796,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