I'm trying to figure out how to embed youtube videos into android using eclipse. I would prefer to use the chromeless player, but at this point it's not necessary.
Any help on how to do this would be greatly appreciated.
A great alternative free to use, open-source API that allows you to embed YouTube videos to be played within an Android app is android-youtube-player created by Pierfrancesco Soffritti. android-youtube-player uses a WebView with an IFrame to display and expose the controls to the YouTube player.
The easiest way to embed a Youtube video is to use an intent to fire the Youtube application, like this:
String video_path = "http://www.youtube.com/watch?v=opZ69P-0Jbc";
Uri uri = Uri.parse(video_path);
// With this line the Youtube application, if installed, will launch immediately.
// Without it you will be prompted with a list of the application to choose.
uri = Uri.parse("vnd.youtube:" + uri.getQueryParameter("v"));
Intent intent = new Intent(Intent.ACTION_VIEW, uri);
startActivity(intent);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With