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

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

Issue 2154883003: Make ContentVideoView progress view visible in WebView (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed Java continuation lines identation Created 4 years, 4 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 b4c9ab02a6e349c5824d552d8dfcf289ae422e10..4d6a10c5e7299e27fde2451727c3195791bd3012 100644
--- a/content/browser/media/android/browser_media_player_manager.cc
+++ b/content/browser/media/android/browser_media_player_manager.cc
@@ -565,7 +565,17 @@ void BrowserMediaPlayerManager::OnEnterFullscreen(int player_id) {
}
// There's no ContentVideoView instance so create one.
- video_view_.reset(new ContentVideoView(this, GetContentViewCore()));
+ // If we know the video frame size, use it.
+ gfx::Size natural_video_size;
+ MediaPlayerAndroid* player = GetFullscreenPlayer();
+ if (player && player->IsPlayerReady()) {
+ natural_video_size =
+ gfx::Size(player->GetVideoWidth(), player->GetVideoHeight());
+ }
+
+ video_view_.reset(
+ new ContentVideoView(this, GetContentViewCore(), natural_video_size));
+
base::android::ScopedJavaLocalRef<jobject> j_content_video_view =
video_view_->GetJavaObject(base::android::AttachCurrentThread());
if (!j_content_video_view.is_null()) {
« no previous file with comments | « content/browser/android/content_video_view.cc ('k') | content/browser/media/android/browser_surface_view_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698