项目中需要使用android webview 加载视频。
已经开启activity的硬件加速,已经打开javascript。但是加载视频是始终loading状态。如下图
求解答方案。不要推荐腾讯浏览器内核SDK ^_^
ringa_lee2017-04-18 09:15:56
Add the settings of the following two lines of code to play online videos! Remember to give me the best answer! !
if (Build.VERSION.SDK_INT < 8) {
webview.getSettings().setPluginsEnabled(true);
} else {
webview.getSettings().setPluginState(PluginState.ON);
}
if(Build.VERSION.SDK_INT>= Build.VERSION_CODES.LOLLIPOP) {
webview.getSettings().setMixedContentMode(WebSettings.MIXED_CONTENT_ALWAYS_ALLOW);
}
伊谢尔伦2017-04-18 09:15:56
1. Use a browser to check whether there is a problem with the video playback. If there is a problem, it is caused by the video.
2. After the first step is executed, check whether the settings of the webView are complete. The specific code can be referred to upstairs.