0
在我的HTML文件中,当HTML加载它时,会在后台播放mp3文件。 但它没有播放该文件其给出以下错误。 未能在'HTMLMediaElement'上执行'播放':Android WebView无法在'HTMLMediaElement'上执行'播放':播放mp3文件时出错
在我的HTML文件中,当HTML加载它时,会在后台播放mp3文件。 但它没有播放该文件其给出以下错误。 未能在'HTMLMediaElement'上执行'播放':Android WebView无法在'HTMLMediaElement'上执行'播放':播放mp3文件时出错
got the solution.
it occurs because of I am playing audio file without making any click or not doing any action in webview. to overcome this need to set below property to webview
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1)
{
mWebView.getSettings().setMediaPlaybackRequiresUserGesture(false);
}