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

Side by Side Diff: content/browser/media/android/browser_media_player_manager.cc

Issue 246523006: Force a second video to exit fullscreen (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Removed unnecessary change Created 6 years, 8 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/browser/media/android/browser_media_player_manager.h" 5 #include "content/browser/media/android/browser_media_player_manager.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "content/browser/android/content_view_core_impl.h" 8 #include "content/browser/android/content_view_core_impl.h"
9 #include "content/browser/media/android/browser_demuxer_android.h" 9 #include "content/browser/media/android/browser_demuxer_android.h"
10 #include "content/browser/media/android/media_resource_getter_impl.h" 10 #include "content/browser/media/android/media_resource_getter_impl.h"
(...skipping 462 matching lines...) Expand 10 before | Expand all | Expand 10 after
473 external_video_surface_container_->ReleaseExternalVideoSurface(player_id); 473 external_video_surface_container_->ReleaseExternalVideoSurface(player_id);
474 #endif // defined(VIDEO_HOLE) 474 #endif // defined(VIDEO_HOLE)
475 if (video_view_.get()) { 475 if (video_view_.get()) {
476 fullscreen_player_id_ = player_id; 476 fullscreen_player_id_ = player_id;
477 video_view_->OpenVideo(); 477 video_view_->OpenVideo();
478 } else if (!ContentVideoView::GetInstance()) { 478 } else if (!ContentVideoView::GetInstance()) {
479 // In Android WebView, two ContentViewCores could both try to enter 479 // In Android WebView, two ContentViewCores could both try to enter
480 // fullscreen video, we just ignore the second one. 480 // fullscreen video, we just ignore the second one.
481 fullscreen_player_id_ = player_id; 481 fullscreen_player_id_ = player_id;
482 video_view_.reset(new ContentVideoView(this)); 482 video_view_.reset(new ContentVideoView(this));
483 } else {
484 // Force the second video to exit fullscreen.
485 Send(new MediaPlayerMsg_DidEnterFullscreen(routing_id(), player_id));
486 Send(new MediaPlayerMsg_DidExitFullscreen(routing_id(), player_id));
483 } 487 }
484 } 488 }
485 489
486 void BrowserMediaPlayerManager::OnExitFullscreen(int player_id) { 490 void BrowserMediaPlayerManager::OnExitFullscreen(int player_id) {
487 if (fullscreen_player_id_ == player_id) { 491 if (fullscreen_player_id_ == player_id) {
488 MediaPlayerAndroid* player = GetPlayer(player_id); 492 MediaPlayerAndroid* player = GetPlayer(player_id);
489 if (player) 493 if (player)
490 player->SetVideoSurface(gfx::ScopedJavaSurface()); 494 player->SetVideoSurface(gfx::ScopedJavaSurface());
491 video_view_->OnExitFullscreen(); 495 video_view_->OnExitFullscreen();
492 } 496 }
(...skipping 347 matching lines...) Expand 10 before | Expand all | Expand 10 after
840 #if defined(VIDEO_HOLE) 844 #if defined(VIDEO_HOLE)
841 MediaPlayerAndroid* player = GetPlayer(player_id); 845 MediaPlayerAndroid* player = GetPlayer(player_id);
842 if (player && player->IsSurfaceInUse()) 846 if (player && player->IsSurfaceInUse())
843 return; 847 return;
844 if (external_video_surface_container_) 848 if (external_video_surface_container_)
845 external_video_surface_container_->ReleaseExternalVideoSurface(player_id); 849 external_video_surface_container_->ReleaseExternalVideoSurface(player_id);
846 #endif // defined(VIDEO_HOLE) 850 #endif // defined(VIDEO_HOLE)
847 } 851 }
848 852
849 } // namespace content 853 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698