I know that this question has been asked several time and I had tried several answers but none of them has helped me. I've tried the following answers -
YouTube Video not playing in WebView
YouTube Video not playing in WebView - Android
and many others too.
I'm opening a youtube page in my app and the page is showing fine. But when I'm clicking on the video it doesn't play video, I'm only getting the audio.
Note - I don't want to play a single video using iFrame like others have done. My requirement is to display a youtube page inside a webview where user can browse the list and watch videos, same like what a browser does.
Here is my code -
webView = (WebView) layoutProgressWebview.findViewById(R.id.webView);
webView.setWebChromeClient(new WebChromeClient());
webView.getSettings().setPluginState(WebSettings.PluginState.ON);
webView.getSettings().setUserAgentString(userAgent);
webView.getSettings().setJavaScriptEnabled(true);
webView.setWebViewClient(new WebViewClient());
webView.loadUrl("youtube_channel_page");
In AndroidManifest.xml file, I've enabled
android:hardwareAccelerated="true"
Please help me with this. Thanks