diff options
author | Teng-Hui Zhu <ztenghui@google.com> | 2012-06-18 16:36:33 -0700 |
---|---|---|
committer | Teng-Hui Zhu <ztenghui@google.com> | 2012-06-27 15:53:05 -0700 |
commit | 0675e22b46a05cdd3f6e20133a94bb8448231dfa (patch) | |
tree | 46ef3d75d403aa5ed07dede8a356193c8415267e /Source/WebKit/android/WebCoreSupport/ChromeClientAndroid.cpp | |
parent | 4601e20f7d14b20a1063cae8cc1e87fc85baee39 (diff) | |
download | external_webkit-0675e22b46a05cdd3f6e20133a94bb8448231dfa.zip external_webkit-0675e22b46a05cdd3f6e20133a94bb8448231dfa.tar.gz external_webkit-0675e22b46a05cdd3f6e20133a94bb8448231dfa.tar.bz2 |
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
Diffstat (limited to 'Source/WebKit/android/WebCoreSupport/ChromeClientAndroid.cpp')
-rw-r--r-- | Source/WebKit/android/WebCoreSupport/ChromeClientAndroid.cpp | 19 |
1 files changed, 13 insertions, 6 deletions
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<HTMLMediaElement*>(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) |