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

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: Created 7 years, 3 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 5b3cd356dcbb8fd05fb56427aa9a9d5f348c71a0..d1334959562fb1e99c39e3de847e28bfb7144085 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
@@ -6,6 +6,7 @@ package org.chromium.content.browser;
import android.content.Context;
import android.graphics.Color;
+import android.graphics.PixelFormat;
import android.os.Build;
import android.view.Surface;
import android.view.SurfaceView;
@@ -59,6 +60,7 @@ public class ContentViewRenderView extends FrameLayout {
setBackgroundColor(Color.WHITE);
mSurfaceView = createSurfaceView(getContext());
+ mSurfaceView.setZOrderMediaOverlay(true);
mSurfaceCallback = new SurfaceHolder.Callback() {
@Override
public void surfaceChanged(SurfaceHolder holder, int format, int width, int height) {
@@ -211,6 +213,15 @@ public class ContentViewRenderView extends FrameLayout {
return mSurfaceView.getHolder().getSurface() != null;
}
+ /**
+ * Enter or leave overlay video mode.
+ */
+ 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 ?
@@ -276,4 +287,5 @@ public class ContentViewRenderView extends FrameLayout {
private native void nativeSurfaceSetSize(int nativeContentViewRenderView,
int width, int height);
private native boolean nativeComposite(int nativeContentViewRenderView);
+ private native void nativeSetOverlayVideoMode(int nativeContentViewRenderView, boolean enabled);
}

Powered by Google App Engine
This is Rietveld 408576698