HTML5 video remove overlay play icon

How to remove the overlay play icon (triangle) that appears in the center of the video for a second or so each time the video launches in Android WebView?

Thanks in advance!

+7
android html5-video android-webview
source share
2 answers

If you said about this image enter image description here

This is the image that I had when testing my application on Android 6.0.

You can hide this image. For example:

WebView mWebView = (WebView) findViewById(R.id.web_view); mWebView.setWebChromeClient(new WebChromeClientCustomPoster()); 

Chrome client class:

 private class WebChromeClientCustomPoster extends WebChromeClient { @Override public Bitmap getDefaultVideoPoster() { return Bitmap.createBitmap(10, 10, Bitmap.Config.ARGB_8888); } } 

Read more api

+11
source share

I have found a solution. Just add the attribute 'poster'.

e.g. poster="https://via.placeholder.com/1x1" or poster="noposter"

Note: null values ​​are ignored. ( poster="" )

0
source share

All Articles