From 4d07c48e4882bfc4223ed6f818d2f8cc1d06f328 Mon Sep 17 00:00:00 2001 From: Yuncheol Heo Date: Wed, 7 May 2014 17:29:35 +0900 Subject: [PATCH] Add API definition for WebSettings.setVideoOverlayForEmbeddedEncryptedVideoEnabled. Introduces an API to control the hole-punching for the embedded encrypted media. Bug: 14598993 Change-Id: I6b473e5b38b0bcc243f43dfeba0c2037fcd37af5 --- core/java/android/webkit/WebSettings.java | 32 +++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/core/java/android/webkit/WebSettings.java b/core/java/android/webkit/WebSettings.java index 7c32c5bcb6f93..d14c19ba04b35 100644 --- a/core/java/android/webkit/WebSettings.java +++ b/core/java/android/webkit/WebSettings.java @@ -1460,4 +1460,36 @@ public abstract class WebSettings { * {@link #MIXED_CONTENT_NEVER_ALLOW} or {@link #MIXED_CONTENT_COMPATIBILITY_MODE}. */ public abstract int getMixedContentMode(); + + /** + * Sets whether to use a video overlay for embedded encrypted video. + * In API levels prior to {@link android.os.Build.VERSION_CODES#L}, encrypted video can + * only be rendered directly on a secure video surface, so it had been a hard problem to play + * encrypted video in HTML. When this flag is on, WebView can play encrypted video (MSE/EME) + * by using a video overlay (aka hole-punching) for videos embedded using HTML <video> + * tag.
+ * Caution: This setting is intended for use only in a narrow set of circumstances and apps + * should only enable it if they require playback of encrypted video content. It will impose + * the following limitations on the WebView: + * + * This is not an exhaustive set of constraints and it may vary with new versions of the + * WebView. + * @hide + */ + public abstract void setVideoOverlayForEmbeddedEncryptedVideoEnabled(boolean flag); + + /** + * Gets whether a video overlay will be used for embedded encrypted video. + * + * @return true if WebView uses a video overlay for embedded encrypted video. + * @see #setVideoOverlayForEmbeddedEncryptedVideoEnabled + * @hide + */ + public abstract boolean getVideoOverlayForEmbeddedEncryptedVideoEnabled(); }