How to autoplay HTML5 mp4 video on Android?

后端 未结 15 1073
一向
一向 2020-11-27 05:53

I had developed a mobile page by asp.net to play mp4 video.

I know iOS had disabled the autoplay function to minimize user bandwidth, so how can i autoplay HTML5 mp

15条回答
  •  悲&欢浪女
    2020-11-27 06:16

    In Android 4.4 and above you can remove the need for a user gesture so long as the HTML5 Video component lives in your own WebView

    webview.setWebChromeClient(new WebChromeClient());
    webview.getSettings().setMediaPlaybackRequiresUserGesture(false);
    

    To get the video to autoplay, you'd still need to add autoplay to the video element:

    
    

提交回复
热议问题