views:

93

answers:

1

I want to embed youtube videos in my android app and want to use the youtube api. Is there any way I can do this ?

A: 

To use the video player, you need to call an intent. If you are launching the intent from an existing activity, you would call it like this:

this.startActivity(new Intent(Intent.ACTION_VIEW, "www.youtubelink/whatever"));

where www.youtubelink/whatever is the link to the youtube video you want to play.

EDIT: Actually I should be more precise - that intent just uses the video player, it doesn't directly launch the YouTube app. If the user has the YouTube app installed it will ask them it they want to view the video in the YouTube app. But if your main goal is to play the video, then that will work for you.

Aurora
Thanks for the help, but I actually want to be able to display a certain youtube channel's videos and allow the user to select one of their videos to watch. Do I have to do this manually (parse the source code of the webpage to get each individual video link and then display them) or can I use the youtube api?
You can use the Rss Feed for the channel and then use the Aurora Method ,)
yeradis