• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

android audio and video doesn't play on webview from loaded html page

Ashini

Lurker
Apr 13, 2013
1
0
I am a beginner in android. 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: [HIGH]<video src="soundfile.mp3" onclick="this.play();"></video>.[/HIGH] But how i can change particular(<audio>) tag from loaded html file.
This is my webview settings:
[HIGH]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");[/HIGH]

What i have do for playing audio and video on my weview. please help me to overcome this. Thanks in advance
 

BEST TECH IN 2023

We've been tracking upcoming products and ranking the best tech since 2007. Thanks for trusting our opinion: we get rewarded through affiliate links that earn us a commission and we invite you to learn more about us.

Smartphones