Here is the problem: I can't seem to make a YouTube video work while still inside of a WebViewClient. I have tried using an Intent, but that only redirects to the browser or the YouTube App (when using a vnd:+VIDEO_ID). I would like to be on a youtube page (example: http://www.youtube.com/user/thenewboston) and still be inside of the webview client - the user should not be able to leave the app.
When I have tried this on my own, I am able to see the YouTube mobile page of the video/channel. Everything works except the fact that when I touch the video on my Droid, all it does is highlight the video and then doesn't do anything.
I need this because my application is free and is financed by an advertisement banner across the bottom of the app - which I can only display with WebViewClient not the native Android browser. JavaScript and plug-ins are enabled. I'm using Froyo as the target SDK and do have Adobe Flash Player installed on my phone.
setContentView(R.layout.internetv);
final WebView wv = (WebView) findViewById(R.id.web_holder);
/* for example */
wv.loadUrl("http://www.youtube.com/user/PokeGuideHD");
wv.setWebViewClient(new myClient());
wv.getSettings().setJavaScriptEnabled(true);
wv.getSettings().setPluginsEnabled (true);
wv.getSettings().setBuiltInZoomControls(true);
wv.requestFocus(View.FOCUS_DOWN);
You cannot show them embedded except perhaps on devices that have Flash.
However, if you can parse out the YouTube video details, you may be able to construct an ACTION_VIEW Intent that will show them on the YouTube application...for those Android devices that have the YouTube application.
You might also experiment with HTML5's tag, which AFAIK is supported in the Browser application and may therefore work in WebView.
EDIT:
It will look something like this...
startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("http://www.youtube.com/watch?v=cxLG2wtE7TM")));