Before create app using YouTube Android Player API, you have to "Download and import YouTube Android Player API" and "Re...
* Download and import YouTube Android Player API
Step By Step Process.. Please follow it.
1) New Android Application Project
2) Download and Unzip the File in given URL - https://developers.google.com/youtube/android/player/downloads/
3) Copy the unzipped YouTubeAndroidPlayerApi.jar file to /libs folder in your project. The YouTubeAndroidPlayerApi.jar file should be in /libs sub-folder of your unzipped files.
4) Right click your android application project and then select Java Build Path and click Add jar's
5) Select YouTubeAndroidPlayerApi.jar, and click OK
* Register your app using YouTube Android Player API and obtain API Key
To use YouTube Android Player API in your app, you have to register it and obtain API key.
Login with your Google account in Google APIs Console.
a) Pull-down the Selection on left, and click Create... under Other Projects.
Android Application Project of YouTube Player
Gradle Code
XML Code:
In res File Create Two playerview_demo.xml Files One Vertical And One Horizontal To see the Video in Two Directions
The Vertical playerview_demo.xml Code :
The Horizontal playerview_demo.xml Code :
Java :
Extends The class file with YoutubeFailureActivity
Youtube Failure Activity code:
The Youtube Failure Activity is linked with Developer Key and also it has functionality of youtube player
Now the Developer Key File
Download the source code With some Live Channels Sample Link :
COMMENTS