Index: android_webview/java/src/org/chromium/android_webview/AwContentsClient.java |
diff --git a/android_webview/java/src/org/chromium/android_webview/AwContentsClient.java b/android_webview/java/src/org/chromium/android_webview/AwContentsClient.java |
index 3862b6d239ad2774b87943987b35d2e3c4b46686..5fd95e0cec24695b2199c023bfd338a60eff4673 100644 |
--- a/android_webview/java/src/org/chromium/android_webview/AwContentsClient.java |
+++ b/android_webview/java/src/org/chromium/android_webview/AwContentsClient.java |
@@ -4,6 +4,7 @@ |
package org.chromium.android_webview; |
+import android.content.Context; |
import android.content.pm.ActivityInfo; |
import android.graphics.Bitmap; |
import android.graphics.Picture; |
@@ -22,6 +23,8 @@ import android.webkit.SslErrorHandler; |
import android.webkit.ValueCallback; |
import android.webkit.WebChromeClient; |
+import org.chromium.content.browser.ContentVideoView; |
+import org.chromium.content.browser.ContentVideoViewClient; |
import org.chromium.content.browser.ContentViewClient; |
import org.chromium.content.browser.ContentViewCore; |
import org.chromium.content.browser.WebContentsObserverAndroid; |
@@ -197,6 +200,31 @@ public abstract class AwContentsClient extends ContentViewClient { |
} |
+ private class AwContentVideoViewClient implements ContentVideoViewClient { |
+ @Override |
+ public void onShowCustomView(View view) { |
+ WebChromeClient.CustomViewCallback cb = new WebChromeClient.CustomViewCallback() { |
+ @Override |
+ public void onCustomViewHidden() { |
+ ContentVideoView contentVideoView = ContentVideoView.getContentVideoView(); |
+ if (contentVideoView != null) |
+ contentVideoView.exitFullscreen(false); |
+ } |
+ }; |
+ AwContentsClient.this.onShowCustomView(view, cb); |
+ } |
+ |
+ @Override |
+ public void onDestroyContentVideoView() { |
+ AwContentsClient.this.onHideCustomView(); |
+ } |
+ |
+ @Override |
+ public View getVideoLoadingProgressView() { |
+ return AwContentsClient.this.getVideoLoadingProgressView(); |
+ } |
+ } |
+ |
void installWebContentsObserver(ContentViewCore contentViewCore) { |
if (mWebContentsObserver != null) { |
mWebContentsObserver.detachFromWebContents(); |
@@ -333,4 +361,9 @@ public abstract class AwContentsClient extends ContentViewClient { |
@Override |
final public void onContextualActionBarHidden() { |
} |
+ |
+ @Override |
+ final public ContentVideoViewClient getContentVideoViewClient() { |
+ return new AwContentVideoViewClient(); |
+ } |
joth
2013/05/15 22:38:57
(note you'll need to move this to the inner Conten
michaelbai
2013/05/22 18:08:39
Thanks
On 2013/05/15 22:38:57, joth wrote:
|
} |