Commit 5c5d8a6a authored by qinmin@chromium.org's avatar qinmin@chromium.org

Call Enterfullscreen after player got initialized

It is possible that Enterfullscreen() is called on an video element without src attribute.
Then later on, when the player got initialized, we should let the player enter fullscreen.
The current implementation calls Enterfullscreen first in video url cases.
This will cause an issue that the BrowserMediaPlayerManager doesn't know which player to pass the surface to.
As a result, we should delay EnterFullscreen() call until the player is initialized.
And there is no point to ask a player to enterfullscreen if it is not created.

BUG=400935

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@288000 0039d316-1c4b-4281-b951-d872f2087c98
parent 441a6f89
......@@ -248,9 +248,6 @@ void WebMediaPlayerAndroid::load(LoadType load_type,
info_loader_->Start(frame_);
}
if (player_manager_->ShouldEnterFullscreen(frame_))
player_manager_->EnterFullscreen(player_id_, frame_);
UpdateNetworkState(WebMediaPlayer::NetworkStateLoading);
UpdateReadyState(WebMediaPlayer::ReadyStateHaveNothing);
}
......@@ -945,6 +942,8 @@ void WebMediaPlayerAndroid::InitializePlayer(
player_manager_->Initialize(
player_type_, player_id_, url_, first_party_url, demuxer_client_id,
frame_->document().url());
if (player_manager_->ShouldEnterFullscreen(frame_))
player_manager_->EnterFullscreen(player_id_, frame_);
}
void WebMediaPlayerAndroid::Pause(bool is_media_related_action) {
......
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