Unable to play video using WebView

瘦欲@ 提交于 2019-12-08 07:08:30

I know this is an old post, but I was having the same issue on my Galaxy S3. I solved it with this :

webView.SetWebChromeClient (new WebChromeClient ());

It worked just fine on Nexus 7 without this line, but on Galaxy S3 for some reason it just spun the loading circle forever.

NOTE: I also have these set:

webView.Settings.PluginsEnabled = true;
webView.Settings.JavaScriptEnabled = true;
webView.Settings.SetPluginState (WebSettings.PluginState.On);
webView.SetWebViewClient (new WebViewClient ());

I had the same problem, none of solutions found at others helped me. I have tried many different ways to solve this, but I didn't managed. So, my solution was to display a thumb instead of video, this thumb was an image linking to video source and when this thumb pressed, the video starts in Android native video player. You could try this if didn't resolved it yet.

Later, I found this: https://code.google.com/p/googletv-android-samples/source/browse/#git%2FWebAppNativePlayback It works by playing video in webview as you want, but the problem is you can not control video controls from D-pad keyboard.

Hope you got a solution!

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!