Menu

Play YouTube Video in Android Studio Using Android Youtube Player Library – Pierfrancesco Soffritti

4 Comments



hello guys how are you today my name is
Abdul Aziz Ahwan from Indonesia and welcome back to my youtube channel today’s video
we are going to learn together how do we put YouTube video or how do we show
YouTube video on our Android application in this video we are going to use
library called YouTube player view but before we are going to the main topic of
this video I am so grateful if you want to click the subscribe button to make
this channel crying out ok thank you so much and let’s get started with my video hello guys first of all I want to say
sorry for my English is not good so if the word I use are incorrect please help
me to point out ok so today’s video we are going to learn together how do we
put YouTube video in our application or something like how do we bring our
YouTube video to our Android application ok I think there are many ways to do
that we can use like YouTube API and ExoPlayer and many more
and this video will use a library called YouTubePlayerView, ok this is made by
software engineer of Google the library called Android YouTube player here if you
want to check out the library link in the description below ok so first of all
we need to create Android application in this video I use Android Studio 3.5.3 and then start a new Android Studio project and
then select empty activity and just select next and then we name it as my
YouTube player and then API 21 language Java and just
press finish and wait until the syncing process is finished okay as we can see as usual we have to
file activity_main.xml and then MainActivity.Java
okay and we go to our XML file and we remove textview we need to change this
constraint layout to linear layout and then we set orientation I’m sorry set to
vertical and press control up plus all okay and then we need to go to the
library and we can see on the documentation we need to copy this copy and then go to our build gradle and
then paste in the bottom and then select syncing now okay and the next step
is we need to go to our XML file and then we can call our library here here
YouTube player and then we set width to match_parent and then for the height wrap_content and we can see here and we check other properties like ID, video ID and
then autoplay show fullscreen button and more so the important things that we
need to do is we need to add video ID which is video ID is video ID of our
YouTube video so we can check on the YouTube I want to add my video which is this video my last video so
if we use YouTube API we need to provide like API-Key and more so we need to select this and the video ID is the last of our youtube link so we need to copy this
just copy and then paste here ok and we need to add another properties like
autoplay maybe set true and then show YouTube button set to false set to false and we can try to run our application okay so as we can see we have one video
of my YouTube here so we can see fullscreen button and we hide YouTube
button and we can add as much as we want and we can set it to false just copy
this and we give margin top maybe 16 and we add another video maybe this one
right click and then copy link address and then we we pass here and we remove
this and then we can run our app okay so as we can see we have two YouTube video here we just need to provide video ID from
our YouTube and we can give another properties like autoplay and then show
YouTube button and seekButton and many more so it’s so simple and it’s
officially support by official YouTube we can see on the documentation they are many application that using this library like Reddit, softly, Musibook and many more ok that’s enough my video today
ok that’s all my video today if you want to download like source code link in the
description below and if you have any questions or comment write it down in
the comment field thank you so much and see you again on the next video

Tags: , , , , , , , , , , , , , , , , , , , , , , , ,

4 thoughts on “Play YouTube Video in Android Studio Using Android Youtube Player Library – Pierfrancesco Soffritti”

  1. Rizky says:

    kalo bisa bahasa indo aja bro, penonton indo lebih banyak. kalo bahasa inggris orang india bejibun
    #cumasaran

  2. Teguh Prasetyo says:

    Bro berarti gak perlu pake codingan javanya lagi dong ?

  3. Armand Fotie says:

    Great video Abdul , that real help me in my process my process of learning,thank and don't stop😉

  4. abdulmalik Tech Geek says:

    AbdulAziz Can you make a tutorial about using Kotlin with Android Studio pls?

Leave a Reply

Your email address will not be published. Required fields are marked *