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);
}