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


  1. Ashini

    Ashini New Member

    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

    Advertisement
  2. LilBit

    LilBit Well-Known Member Contributor

    Hi Ashini, Glad to have you here at Android Forums!!:D Have a look in this section and see what others with the same or similar problems have come up with.:)
    Android Media - Android Forums
  3. Rush

    Rush {<>}~{<>} Guide

    Hi Ashini .. :)

    Welcome to our community. Hopefully you'll find our forum useful.
Loading...

Share This Page