I am working on an application where I want to show youtube videos in a fragment that has CardsViews, my cardviews already work without problem, the problem is that the videos are not reproduced, I always miss an error:
I am adding the videos in a WebView and the links of the videos I use them in the following way: link \ "+ yS_p_ICLUAw + \"? autoplay = 1 & vq = small
The configuration of the WebView is as follows:
holder.reproductor.loadUrl(tips.getEnlace());
holder.reproductor.getSettings().setJavaScriptEnabled(true);
holder.reproductor.setWebViewClient(new WebViewClient(){
@Override
public void onPageStarted(WebView view, String url, Bitmap favicon) {
super.onPageStarted(view, url, favicon);
}
@Override
public void onPageFinished(WebView view, String url) {
super.onPageFinished(view, url);
}
});
holder.reproductor.setWebChromeClient(new WebChromeClient(){
@Override
public void onProgressChanged(WebView view, int newProgress) {
super.onProgressChanged(view, newProgress);
}
@Override
public void onReceivedTitle(WebView view, String title) {
super.onReceivedTitle(view, title);
}
});
This is the error that shows with the URL that I put in the WebView: