Android KitKat (4.4) autoplay video no longer works in webview

in previous versions of Android, we were able to start the video by calling the play () method on the video js element or by simulating a click event on it (only for some specific devices, such as the nexus, on which the video does not start at all), now it works more .. I understand that we should not allow this for the Android version of android or the Android web browser, but why also inside the webview?

+2
source share
1 answer

Try calling WebView.getSettings().setMediaPlaybackRequiresUserGesture(false)for your webview.

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

+13

Source: https://habr.com/ru/post/1533862/


All Articles