HTML5 video remove overlay play icon

前端 未结 2 1133
执念已碎
执念已碎 2020-12-16 15:41

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?

2条回答
  •  不知归路
    2020-12-16 16:37

    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

提交回复
热议问题