Android的奇巧(4.4)视频自动播放不能在web视图工作了奇巧、能在、视图、自动播放

由网友(爱上一匹野马@)分享简介:在Android上的previous的版本中,我们可以通过调用播放()视频JS元法,或在其上模拟单击事件(仅适用于某些具体的设备,如关系开始视频在其上视频没有启动的话),现在它的工作了......我明白,我们不应该让这种针对Android版本的Chrome或Android网页浏览器,但为什么还有里面的WebView?...

在Android上的previous的版本中,我们可以通过调用播放()视频JS元法,或在其上模拟单击事件(仅适用于某些具体的设备,如关系开始视频在其上视频没有启动的话),现在它的工作了......我明白,我们不应该让这种针对Android版本的Chrome或Android网页浏览器,但为什么还有里面的WebView?

on previous versions of Android, we were be able to start a video by calling play() method on video js element or by simulating a click event on it (only for some specifics devices such as nexus on which the video does not start at all), now it's working anymore... i understand that we should not allow this for android chrome version or android web navigator, but why also inside webview ?

推荐答案

请尝试调用 WebView.getSettings()。setMediaPlaybackRequiresUserGesture(假)为您的WebView。

Please try calling WebView.getSettings().setMediaPlaybackRequiresUserGesture(false) for your WebView.

(见http://developer.android.com/reference/android/webkit/WebSettings.html#setMediaPlaybackRequiresUserGesture(boolean) )

阅读全文

相关推荐

最新文章