1. Check out our companion app, Forums for Android! Download from Google Play

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

Discussion in 'Introductions' started by Ashini, Apr 13, 2013.

  1. Ashini

    Ashini New Member
    Thread Starter
    25

    Apr 13, 2013
    1
    0
    25
    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
    533

    Sep 1, 2012
    5,865
    3,306
    533
    Female
    U.S.A.
    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 {<>}~{<>}
    1,043

    Jan 31, 2011
    18,743
    3,162
    1,043
    Male
    Entrepreneur / Business Owner - Freelance Writer
    Loganville, GA
    Hi Ashini .. :)

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

Share This Page

Loading...