I am developing epub reader for Android devices. Audio and video doesn't play on webview from loaded HTML page. It seems like audio and video tags are not working. I have seen some solution like this:<video src="soundfile.mp3" onclick="this.play();"></video>
. But how I can change particular (<audio>
) tag from loaded HTML file.
This is my webview settings:
final WebView webView = (WebView) findViewById(R.id.webView);
webView.getSettings().setJavaScriptEnabled(true);
webView.getSettings().setUseWideViewPort(true);
webView.getSettings().setLoadWithOverviewMode(true);
webView.getSettings().setPluginsEnabled(true);
webView.getSettings().setPluginState(PluginState.ON);
webView.setWebViewClient(new MyCustomWebViewClient());
webView.setScrollBarStyle(View.SCROLLBARS_INSIDE_OVERLAY);
webView.loadUrl("about:blank");
webView.loadUrl("file:///mnt/sdcard/myfolder/epubfile/OPS/02-audioDemo.xhtml");
What I have do for playing audio and video on my weview. Please help me to overcome this.