HTML5 video remove overlay play icon

穿精又带淫゛_ 提交于 2019-12-29 06:56:12

问题


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!


回答1:


If you said about this picture

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




回答2:


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="")



来源:https://stackoverflow.com/questions/18271991/html5-video-remove-overlay-play-icon

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!