From 0675e22b46a05cdd3f6e20133a94bb8448231dfa Mon Sep 17 00:00:00 2001 From: Teng-Hui Zhu Date: Mon, 18 Jun 2012 16:36:33 -0700 Subject: Support fullscreen to inline video transition. Basically, player is responsible to enter fullscreen mode such that we have the proper proxy updated on the Java side. bug:5710646 framework change: https://android-git.corp.google.com/g/#/c/202139/ Change-Id: Ie7adf620f2e9889142ef153e12d676a5f288bc0a --- .../android/WebCoreSupport/ChromeClientAndroid.cpp | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) (limited to 'Source/WebKit/android/WebCoreSupport/ChromeClientAndroid.cpp') diff --git a/Source/WebKit/android/WebCoreSupport/ChromeClientAndroid.cpp b/Source/WebKit/android/WebCoreSupport/ChromeClientAndroid.cpp index e00b77b..9094732 100644 --- a/Source/WebKit/android/WebCoreSupport/ChromeClientAndroid.cpp +++ b/Source/WebKit/android/WebCoreSupport/ChromeClientAndroid.cpp @@ -584,16 +584,23 @@ void ChromeClientAndroid::enterFullscreenForNode(Node* node) return; HTMLMediaElement* videoElement = static_cast(node); - String url = videoElement->currentSrc(); - LayerAndroid* layer = videoElement->platformLayer(); - if (!layer) - return; FrameView* frameView = m_webFrame->page()->mainFrame()->view(); android::WebViewCore* core = android::WebViewCore::getWebViewCore(frameView); - m_webFrame->page()->mainFrame()->document()->webkitWillEnterFullScreenForElement(videoElement); if (core) - core->enterFullscreenForVideoLayer(layer->uniqueId(), url); + core->enterFullscreenForVideoLayer(); + + MediaPlayer* player = videoElement->player(); + if (player) { + // We need to use the same document object as the + // MediaPlayerPrivateAndroid::onStopFullscreen(). + Document* doc = player->mediaPlayerClient()->mediaPlayerOwningDocument(); + if (doc) + doc->webkitWillEnterFullScreenForElement(videoElement); + // Now the player is responsible to trigger to the java side for + // entering full screen mode. + player->enterFullscreenMode(); + } } void ChromeClientAndroid::exitFullscreenForNode(Node* node) -- cgit v1.1