I am trying to create a page in an application that loads a YouTube channel inside a WebView. Almost everything works for me, except for the actual video playback. As if inside a WebView, when I click on a video to play it, the message is lost. I do not see a call to the shouldOverrideUrlLoading () function, as expected.
The code:
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.webview);
webView = (WebView)findViewById(R.id.webview);
webView.getSettings().setJavaScriptEnabled(true);
webView.setWebViewClient(new webViewClient());
webView.loadUrl(getIntent().getStringExtra("url"));
}
private class webViewClient extends WebViewClient {
public boolean shouldOverrideUrlLoading(WebView view, String url) {
if (url.equals("about:blank")) {
return true;
}
view.loadUrl(url);
return true;
}
}
The download URL is as follows: http://www.youtube.com/tinhtevideo . Am I missing something? I would make exepct that shouldOverridingUrlLoading () would be called with a URL like "vnd.youtube:", but I never saw it.
Of course, if I load the above URL in the Android browser, everything works fine.