I have a problem when load html5 into webview. My app in first build play video success but when i clear/kill app open again, webview not play video when click play.
- Html5
<video src="url.mp4" controls poster="thumbnail.jpg" style="max-width: 100%;"><a href="url.mp4">Download video</a></video>
- Source load webview
WebView webView = new WebView(context);
webView.getSettings().setJavaScriptEnabled(true);
webView.getSettings().setCacheMode(WebSettings.LOAD_NO_CACHE);
webView.setWebChromeClient(new WebChromeClient());
webView.setWebViewClient(new WebViewClient());
String html = "<html><head><link rel='stylesheet' href='file:///android_asset/css/style.css'></head><body>"
+ htmlElement.getContent()
+ "</body></html>";
webView.loadDataWithBaseURL("file:///android_asset/", html, mimetype, encoding, "");
I research and try fix this issue but not success
https://stackoverflow.com/questions/3815090/webview-and-html5-video
https://issuetracker.google.com/issues/36935939
v.v..
Anyone has the same my problem? Thanks.