I want to play videos in website (which is displayed in android webview).I have locally store all html pages and videos into assets folder of android project and i am displaying website from that assets folder into web view.
The problem is that in web site there are some videos and it is not played in android web view ( it just display me loading circle ) .I tried setpluging on , javascript on , i tried iframe in Html and Video and video src TAG in html but no luck to play video files locally.
Any budy please help me to play video files on web page which loaded on webview of android Thank you
oncreate(){
setContentView(R.layout.activity_main);
WebView webView= (WebView)findViewById(R.id.webView);
webView.getSettings().setSupportZoom(true);
webView.getSettings().setBuiltInZoomControls(true);
webView.setScrollBarStyle(WebView.SCROLLBARS_OUTSIDE_OVERLAY);
webView.setScrollbarFadingEnabled(true);
webView.getSettings().setLoadsImagesAutomatically(true);
webView.setWebChromeClient(new WebChromeClient());
webView.setWebViewClient(new WebViewClient());
WebSettings webSettings = webView.getSettings();
webSettings.setJavaScriptEnabled(true);
webSettings.setPluginState(WebSettings.PluginState.ON);
webView.loadUrl("file:///android_asset/index.html");
}
<video width="320" height="240" controls="controls" name="media">
<source src="twitter.mp4" type="video/mp4">// i tried src="file:///android_asset/twitter.mp4" but no luck
</video>