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

Unified Diff: content/public/android/java/src/org/chromium/content/browser/ContentViewRenderView.java

Issue 25040002: Enables fullscreen subtitle and media control from Blink (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@build_hack
Patch Set: rebased, let's go! Created 6 years, 11 months 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
Index: content/public/android/java/src/org/chromium/content/browser/ContentViewRenderView.java
diff --git a/content/public/android/java/src/org/chromium/content/browser/ContentViewRenderView.java b/content/public/android/java/src/org/chromium/content/browser/ContentViewRenderView.java
index 797d87273e2003a8d33d1c51c33e8d0a6d1ae8eb..851b1e60b42ab86b0bad569007794646e0c80f16 100644
--- a/content/public/android/java/src/org/chromium/content/browser/ContentViewRenderView.java
+++ b/content/public/android/java/src/org/chromium/content/browser/ContentViewRenderView.java
@@ -8,6 +8,7 @@ import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.Color;
+import android.graphics.PixelFormat;
import android.os.Build;
import android.os.Handler;
import android.view.Surface;
@@ -61,6 +62,7 @@ public class ContentViewRenderView extends FrameLayout {
assert mNativeContentViewRenderView != 0;
mSurfaceView = createSurfaceView(getContext());
+ mSurfaceView.setZOrderMediaOverlay(true);
mSurfaceCallback = new SurfaceHolder.Callback() {
@Override
public void surfaceChanged(SurfaceHolder holder, int format, int width, int height) {
@@ -237,6 +239,16 @@ public class ContentViewRenderView extends FrameLayout {
return mSurfaceView.getHolder().getSurface() != null;
}
+ /**
+ * Enter or leave overlay video mode.
+ * @param enabled Whether overlay mode is enabled.
+ */
+ public void setOverlayVideoMode(boolean enabled) {
+ int format = enabled ? PixelFormat.TRANSLUCENT : PixelFormat.OPAQUE;
+ mSurfaceView.getHolder().setFormat(format);
+ nativeSetOverlayVideoMode(mNativeContentViewRenderView, enabled);
+ }
+
@CalledByNative
private void requestRender() {
ContentViewCore contentViewCore = mCurrentContentView != null ?
@@ -311,4 +323,6 @@ public class ContentViewRenderView extends FrameLayout {
int width, int height);
private native boolean nativeComposite(long nativeContentViewRenderView);
private native boolean nativeCompositeToBitmap(long nativeContentViewRenderView, Bitmap bitmap);
+ private native void nativeSetOverlayVideoMode(long nativeContentViewRenderView,
+ boolean enabled);
}

Powered by Google App Engine
This is Rietveld 408576698