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

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

Issue 41123002: Request video element to enter fullscreen when playing protected content (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 years, 1 month 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
« no previous file with comments | « no previous file | content/common/media/media_player_messages_android.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 e9e36fc5a42693531b970526b8a18e97312f60cd..682ef3f3738aac18124cf1ff6939e3f56683e906 100644
--- a/content/browser/media/android/browser_media_player_manager.cc
+++ b/content/browser/media/android/browser_media_player_manager.cc
@@ -17,6 +17,7 @@
#include "content/public/browser/storage_partition.h"
#include "content/public/browser/web_contents.h"
#include "content/public/browser/web_contents_delegate.h"
+#include "content/public/common/content_switches.h"
#include "media/base/android/media_drm_bridge.h"
#include "media/base/android/media_player_bridge.h"
#include "media/base/android/media_source_player.h"
@@ -325,7 +326,18 @@ void BrowserMediaPlayerManager::OnProtectedSurfaceRequested(int player_id) {
return;
}
- OnEnterFullscreen(player_id);
+ // Send an IPC to the render process to request the video element to enter
+ // fullscreen. OnEnterFullscreen() will be called later on success.
+ // This guarantees the fullscreen video will be rendered correctly.
+ // During the process, DisableFullscreenEncryptedMediaPlayback() may get
+ // called before or after OnEnterFullscreen(). If it is called before
+ // OnEnterFullscreen(), the player will not enter fullscreen. And it will
+ // retry the process once the GenerateKeyRequest is allowed to proceed
+ // TODO(qinmin): make this flag default on android.
+ if (CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kDisableGestureRequirementForMediaFullscreen)) {
+ Send(new MediaPlayerMsg_RequestFullscreen(routing_id(), player_id));
+ }
}
void BrowserMediaPlayerManager::OnKeyAdded(int media_keys_id,
@@ -395,6 +407,10 @@ void BrowserMediaPlayerManager::DisableFullscreenEncryptedMediaPlayback() {
void BrowserMediaPlayerManager::OnEnterFullscreen(int player_id) {
DCHECK_EQ(fullscreen_player_id_, -1);
+ if (media_keys_ids_pending_approval_.find(player_id) !=
+ media_keys_ids_pending_approval_.end()) {
+ return;
+ }
if (video_view_.get()) {
fullscreen_player_id_ = player_id;
« no previous file with comments | « no previous file | content/common/media/media_player_messages_android.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698