Unlock the Power of Open Source! The " Linux New " SWAYAM Plus Course is live now and about 2,500 learners have already registered for it.

If you are a registered learner, the forum page is now active. Visit the page and get all your questions answered.

Playing video using YouTube API - English

This is a sample video. To access the full content,
please Login

8401 visits



Outline:

Create a new project in Google cloud Generate the API key and save it Enable the YouTube API How to use YouTubePlayerView provided by YouTube Initialize the view to play a video from YouTube, by giving the video ID Download the YouTubeAndroidPlayerApi.jar file from the developers website Copy the above file in the Android Studio project Source code for YouTube player cueVideo method Run the Kotlin App and play the video