Embedding youtube videos in your android app
I want to em开发者_高级运维bed youtube videos in my android app and want to use the youtube api. Is there any way I can do this ?
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.
精彩评论