Commit 5f328dba authored by qinmin's avatar qinmin Committed by Commit bot

Fix the loop behavior on android

During loop, player should not be in a paused state
This change fix that behavior

Layout test:https://codereview.chromium.org/585563003/

BUG=415651

Review URL: https://codereview.chromium.org/580093005

Cr-Commit-Position: refs/heads/master@{#295585}
parent 6b730574
...@@ -142,7 +142,6 @@ WebMediaPlayerAndroid::WebMediaPlayerAndroid( ...@@ -142,7 +142,6 @@ WebMediaPlayerAndroid::WebMediaPlayerAndroid(
stream_texture_factory_(factory), stream_texture_factory_(factory),
needs_external_surface_(false), needs_external_surface_(false),
video_frame_provider_client_(NULL), video_frame_provider_client_(NULL),
pending_playback_(false),
player_type_(MEDIA_PLAYER_TYPE_URL), player_type_(MEDIA_PLAYER_TYPE_URL),
is_remote_(false), is_remote_(false),
media_log_(media_log), media_log_(media_log),
...@@ -766,14 +765,11 @@ void WebMediaPlayerAndroid::OnPlaybackComplete() { ...@@ -766,14 +765,11 @@ void WebMediaPlayerAndroid::OnPlaybackComplete() {
interpolator_.SetBounds(duration_, duration_); interpolator_.SetBounds(duration_, duration_);
client_->timeChanged(); client_->timeChanged();
// if the loop attribute is set, timeChanged() will update the current time // 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 // to 0. It will perform a seek to 0. Issue a command to the player to start
// process are sequential, the OnSeekComplete() will only occur // playing after seek completes.
// once OnPlaybackComplete() is done. As the playback can only be executed
// upon completion of OnSeekComplete(), the request needs to be saved.
UpdatePlayingState(false);
if (seeking_ && seek_time_ == base::TimeDelta()) if (seeking_ && seek_time_ == base::TimeDelta())
pending_playback_ = true; player_manager_->Start(player_id_);
} }
void WebMediaPlayerAndroid::OnBufferingUpdate(int percentage) { void WebMediaPlayerAndroid::OnBufferingUpdate(int percentage) {
...@@ -800,11 +796,6 @@ void WebMediaPlayerAndroid::OnSeekComplete( ...@@ -800,11 +796,6 @@ void WebMediaPlayerAndroid::OnSeekComplete(
UpdateReadyState(WebMediaPlayer::ReadyStateHaveEnoughData); UpdateReadyState(WebMediaPlayer::ReadyStateHaveEnoughData);
client_->timeChanged(); client_->timeChanged();
if (pending_playback_) {
play();
pending_playback_ = false;
}
} }
void WebMediaPlayerAndroid::OnMediaError(int error_type) { void WebMediaPlayerAndroid::OnMediaError(int error_type) {
......
...@@ -459,10 +459,6 @@ class WebMediaPlayerAndroid : public blink::WebMediaPlayer, ...@@ -459,10 +459,6 @@ class WebMediaPlayerAndroid : public blink::WebMediaPlayer,
scoped_ptr<MediaSourceDelegate, scoped_ptr<MediaSourceDelegate,
MediaSourceDelegate::Destroyer> media_source_delegate_; MediaSourceDelegate::Destroyer> media_source_delegate_;
// Internal pending playback state.
// Store a playback request that cannot be started immediately.
bool pending_playback_;
MediaPlayerHostMsg_Initialize_Type player_type_; MediaPlayerHostMsg_Initialize_Type player_type_;
// Whether the browser is currently connected to a remote media player. // Whether the browser is currently connected to a remote media player.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment