I’d like to disable Youtube embedded videos on a WebView, preferably replace them with a link to the Youtube page (that will open the browser picker when clicked)…
This is my (quite generic) webview :
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_parodia);
BlogView = (WebView) findViewById(R.id.blogview);
BlogView.setWebViewClient(new CustomClient());
WebSettings webSettings = BlogView.getSettings();
webSettings.setJavaScriptEnabled(true);
BlogView.loadUrl("http://test.blogspot.com/?m=1");
}
EDIT: something like this is what i’m looking for, any help on how implement it on the android webview?
Just load in jquery and this script. This will replace youtube iframes and object tags with a screenshot from the video and a link to youtube. Tested on a SE Xperia X10 & Nexus 7.
Set up your webview to handle youtube like this:
WebViewClient mWebClient = new WebViewClient() {