问题
How to play YouTube video in Android native player? If any one achieved this please let me know the way.
回答1:
http://apiblog.youtube.com/2012/12/no-webview-required-with-native-youtube.html
maybe this link will be of some assistance ? There are various API's out there that can achieve this for you.
API, an abbreviation of application program interface, is a set of routines, protocols, and tools for building software applications. A good API makes it easier to develop a program by providing all the building blocks. A programmer then puts the blocks together. This API in particular should offer you the best assistance.
回答2:
You can check out the API here: https://developers.google.com/youtube/android/player/downloads/
Then you need to register your application (get an API key) https://developers.google.com/youtube/android/player/register
And then you can simply add the required methods to your Activity: https://developers.google.com/youtube/android/player/reference/com/google/android/youtube/player/YouTubePlayerView
There is also the createPlayVideoIntentWithOptions, it opens up the native youtube application installed on the device
public static Intent createPlayVideoIntentWithOptions (Context context, String videoId, boolean fullscreen, boolean finishOnEnd)
回答3:
Tryout the link below; http://www.androidhive.info/2014/12/how-to-play-youtube-video-in-android-app/
It's a step by step tutorial.
来源:https://stackoverflow.com/questions/19534647/how-to-play-youtube-video-in-android-native-player