Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

HTML5 video remove overlay play icon

How do I remove the overlay play icon (triangle) that's visible in the center of the video for a second or so every time a video starts playing in an Android WebView?

Thanks in advance!

like image 847
user2106314 Avatar asked Aug 16 '13 11:08

user2106314


2 Answers

If you said about this picture enter image description here

This is picture I had when tested my app on Android 6.0.

You can hide this picture. 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);
    }
}

More info read api

like image 66
AndreyNik Avatar answered Sep 20 '22 11:09

AndreyNik


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

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

Note: Empty value are ignored. (poster="")

like image 37
kohashi Avatar answered Sep 20 '22 11:09

kohashi