Skip to content Skip to sidebar Skip to footer

Html Video Not Playing In Android Webview

i am working with android webview and here i stucked with the videos .Actually i am trying to play a video that is in asset folder but its not playing. Here i have gone through all

Solution 1:

It happens when video is in a div, you should add these lines in your code:

    webView.getSettings().setDomStorageEnabled(true);
    webView.getSettings().setAppCacheEnabled(true);
    webView.getSettings().setAppCachePath(getApplicationContext().getFilesDir().getAbsolutePath() + "/cache");
    webView.getSettings().setDatabaseEnabled(true);
    webView.getSettings().setDatabasePath(getApplicationContext().getFilesDir().getAbsolutePath() + "/databases");

Solution 2:

Next to the WebViewClient, you should also add WebChromeClient to the WebView.

webView.setWebViewClient(new MyWebViewClient());               
webView.setWebChromeClient(new WebChromeClient());
webView.getSettings().setJavaScriptEnabled(true);              
webView.loadUrl("http://118.102.182.53:9080/swami/index.html");

For Android version 3.x you can also set hardwareAccelerated="true in the AndroidManifest.xml.

Solution 3:

Just add android:hardwareAccelerated="true" for your activity tag in AndroidManifest.xml

Post a Comment for "Html Video Not Playing In Android Webview"