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

Unified Diff: content/browser/media/android/browser_media_player_manager.cc

Issue 157783004: Partial revert of "Restart fullscreen video playback when switching back from background" (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebased Created 6 years, 10 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
Index: content/browser/media/android/browser_media_player_manager.cc
diff --git a/content/browser/media/android/browser_media_player_manager.cc b/content/browser/media/android/browser_media_player_manager.cc
index 3e0c153d78940e6a26c199af8874392098bccc19..ba7c0198c5d2dd43e9008c6e66185030514551d2 100644
--- a/content/browser/media/android/browser_media_player_manager.cc
+++ b/content/browser/media/android/browser_media_player_manager.cc
@@ -116,6 +116,7 @@ BrowserMediaPlayerManager::BrowserMediaPlayerManager(
: WebContentsObserver(WebContents::FromRenderViewHost(render_view_host)),
fullscreen_player_id_(-1),
pending_fullscreen_player_id_(-1),
+ fullscreen_player_is_released_(false),
web_contents_(WebContents::FromRenderViewHost(render_view_host)),
weak_ptr_factory_(this) {
}
@@ -155,6 +156,10 @@ bool BrowserMediaPlayerManager::OnMessageReceived(const IPC::Message& msg) {
void BrowserMediaPlayerManager::FullscreenPlayerPlay() {
MediaPlayerAndroid* player = GetFullscreenPlayer();
if (player) {
+ if (fullscreen_player_is_released_) {
+ video_view_->OpenVideo();
+ fullscreen_player_is_released_ = false;
+ }
player->Start();
Send(new MediaPlayerMsg_DidMediaPlayerPlay(
routing_id(), fullscreen_player_id_));
@@ -206,19 +211,6 @@ void BrowserMediaPlayerManager::ExitFullscreen(bool release_media_player) {
player->SetVideoSurface(gfx::ScopedJavaSurface());
}
-void BrowserMediaPlayerManager::SuspendFullscreen() {
- MediaPlayerAndroid* player = GetFullscreenPlayer();
- if (player)
- player->SetVideoSurface(gfx::ScopedJavaSurface());
-}
-
-void BrowserMediaPlayerManager::ResumeFullscreen(
- gfx::ScopedJavaSurface surface) {
- MediaPlayerAndroid* player = GetFullscreenPlayer();
- if (player)
- player->SetVideoSurface(surface.Pass());
-}
-
void BrowserMediaPlayerManager::OnTimeUpdate(int player_id,
base::TimeDelta current_time) {
Send(new MediaPlayerMsg_MediaTimeUpdate(
@@ -571,6 +563,8 @@ void BrowserMediaPlayerManager::OnReleaseResources(int player_id) {
MediaPlayerAndroid* player = GetPlayer(player_id);
if (player)
player->Release();
+ if (player_id == fullscreen_player_id_)
+ fullscreen_player_is_released_ = true;
#if defined(VIDEO_HOLE)
WebContentsViewAndroid* view =
« no previous file with comments | « content/browser/media/android/browser_media_player_manager.h ('k') | content/public/browser/android/content_view_core.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698