在我的HTML文件中加载HTML时,它会在后台播放mp3文件。 但它没有播放该文件,它给出了以下错误。 无法执行' play'在' HTMLMediaElement':
答案 0 :(得分:0)
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);
}