0

please i want way to play youtube video in videoview

I looked at a lot of solutions and pages, but I can not find an answer to this question Please give me a definite solution to this question

Thank you

2 Answers2

1

Hay behalf of VideoView its much better to use Google's YouTube Android Player API, if your need is specific to play YouTube video, Using this you can directly embed all of the functionality of YouTube in your application.

You can do it by simply following below steps_

  1. You should target your application to at least Android 2.2. ( e.g., android:minSdkVersion="8" or API level 8)
  2. Next you need to Registering your application to get an API key. It's free, you need your Google account to get it. You need SHA1 key of your application that you can Get SHA1 key for your application.
  3. Download - YouTube Android Player API and Unzip the compressed folder, locate the YouTubeAndroidPlayerApi.jar, and add it to your project's /libs folder.
  4. Add INTERNET to your manifest (<uses-permission android:name="android.permission.INTERNET"></uses-permission>)
  5. That`s all you are completely set to get a ride on. You can find YouTube demo Sample Applications, youtube - android-player .

I hope this will help you and all! :)

Community
  • 1
  • 1
Rupesh Yadav
  • 12,096
  • 4
  • 53
  • 70
0

YouTube has an official YouTube Android Player API specifically designed to play YouTube videos within your applications. You may consider looking at YouTubePlayerFragment which allows you to easily embed a video player.

ianhanniballake
  • 191,609
  • 30
  • 470
  • 443