Sunday, January 31, 2016

Android YouTube API

The Youtube player API allows user to load and play YouTube videos. Using the API, we can load or cue video into a player view embedded in applications UI. With this, we can also control the playback programmatically. 

The steps for including this are like below 

1. Download the Jar file 
2. Register the application 
3. setup the application 

In detail below are the overall steps. 

the jar file was named like YouTubeAndroidPlayerApi-1.2.2.zip. This zip file has docs, samples and the jar file for the API set.

Registering part included below items

1. On the Google API console, enable the Youtube Data API v3.  
2. there are two ways to use this API. Key and the OAuth 2.0. 

Adding the Key is simple. We can create this as Android, iOS Server or Client key. In this case, the Android key is what we needed.  

to run the sample, i tried to import the eclipse project given along with it to Android studio, but it complained saying that it needs platform 19. 

thats it! 

references:

No comments:

Post a Comment