1. Downloading YouTube Player API
Before you start writing some code, you’ll have to first download the YouTube Android Player API. Once downloaded import the jar into your project lib folder and add the jar to your build path.Download YouTube Player API here
2. Register your app in Google developer console
- Before you start using the Youtube player API for android, you have to register your application with Google developer console and get and API key, The API key is a unique value for your application. Do not disclose this to others.
- Visit Google APIs Console and login with your Google account and create a new project
- Once your project is created, got to API’s and enable “YouTube data API V3”
- And then Select “API Access” in your API Console. You’ll find API key. This API key will be used to access YouTube Android Player APIs.
3. Create a new Android Application project
Now you are ready to create Android project to play YouTube videos using YouTube player API. You may use IDE of your choice, here I am using Eclipse.You need INTERNET permission to play video over internet. Add below permission in your application AndroidManifest.xml file.
<uses-permission android:name="android.permission.INTERNET" />
Nenhum comentário:
Postar um comentário