summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Ben Murdoch <benm@google.com> 2010-11-11 15:56:16 +0000
committer Ben Murdoch <benm@google.com> 2010-11-11 16:07:26 +0000
commit1708ad53c3669b72d20724e52301eecd35e86377 (patch)
tree3157c8223045602478bec65d7d8a513624dd7b0f
parentfac4a689f86b0d46a2c76cec0a6ce2f4bac2a22a (diff)
Hide plugin views when we start playing HTML5 video
Plugins like Flash draw directly to the screen on top of all other views - including the fullscreen HTML5 video view. This means that if you start an HTML5 video on a page also serving a flash clip then flash will obscure the video. This patch hides plugin views before start the video and shows them again when the VideoView is destroyed. Bug: 3183521 Change-Id: I9839c47e9d64b081651b952057e9283630362b29
-rw-r--r--core/java/android/webkit/HTML5VideoViewProxy.java11
-rw-r--r--core/java/android/webkit/WebView.java4
2 files changed, 15 insertions, 0 deletions
diff --git a/core/java/android/webkit/HTML5VideoViewProxy.java b/core/java/android/webkit/HTML5VideoViewProxy.java
index 6769563d4392..85bff4f01fe5 100644
--- a/core/java/android/webkit/HTML5VideoViewProxy.java
+++ b/core/java/android/webkit/HTML5VideoViewProxy.java
@@ -138,6 +138,10 @@ class HTML5VideoViewProxy extends Handler
mCurrentProxy.dispatchOnEnded();
else
mCurrentProxy.dispatchOnPaused();
+
+ // Re enable plugin views.
+ mCurrentProxy.getWebView().getViewManager().showAll();
+
isVideoSelfEnded = false;
mCurrentProxy = null;
mLayout.removeView(mVideoView);
@@ -199,6 +203,9 @@ class HTML5VideoViewProxy extends Handler
mTimer = new Timer();
mVideoView.start();
client.onShowCustomView(mLayout, mCallback);
+ // Plugins like Flash will draw over the video so hide
+ // them while we're playing.
+ mCurrentProxy.getWebView().getViewManager().hideAll();
}
public static boolean isPlaying(HTML5VideoViewProxy proxy) {
@@ -599,6 +606,10 @@ class HTML5VideoViewProxy extends Handler
return new HTML5VideoViewProxy(webViewCore.getWebView(), nativePtr);
}
+ /* package */ WebView getWebView() {
+ return mWebView;
+ }
+
private native void nativeOnPrepared(int duration, int width, int height, int nativePointer);
private native void nativeOnEnded(int nativePointer);
private native void nativeOnPaused(int nativePointer);
diff --git a/core/java/android/webkit/WebView.java b/core/java/android/webkit/WebView.java
index bcd03328d9bd..191542529a36 100644
--- a/core/java/android/webkit/WebView.java
+++ b/core/java/android/webkit/WebView.java
@@ -7845,6 +7845,10 @@ public class WebView extends AbsoluteLayout
nativeUpdateCachedTextfield(updatedText, mTextGeneration);
}
+ /* package */ ViewManager getViewManager() {
+ return mViewManager;
+ }
+
private native int nativeCacheHitFramePointer();
private native Rect nativeCacheHitNodeBounds();
private native int nativeCacheHitNodePointer();