Android App Development
iOS App Development
Cross Platform App Development
Hire on-demand project developers and turn your idea into working reality.
Big thanks to Webkul and his team for helping get Opencart 126.96.36.199 release ready!
If we want to show the video to our android application then we do not store the video inside the project, this will increase the app size. So instead, we can upload the video to YouTube and stream it in the app to decreases the app size.
So In this blog,
I have shown you how to play the video in your own android app.
We have been already interacting with Google APIs, So we need to get the Google Developer API Key first.
Follow below steps to obtain your Google Developer Android API Key.
Open the layout file of your activity (activity_main.xml) and add below code. This creates a simple layout with YouTubePlayerView.
A view for displaying YouTube videos. Using this View directly is an alternative to using theYouTubePlayerFragment. If you choose to use this view directly, your activity needs to extend YouTubeBaseActivity.
To get started, place this view in your view hierarchy and call initialize(String, OnInitializedListener) to create a YouTubePlayer which you can use to load videos into this View.
This view will save and restore the state of the YouTubePlayer associated with the view as part of the onSaveInstanceState/onRestoreInstanceState flow.
This activity also contains few initialization listener methods to know the status of the youtube player.
Maybe this tutorial is worked for you.
Your email address will not be published. Required fields are marked*
Save my name email and website in this browser for the next time I comment.
Be the first to comment.
Excellent work, fast, good quality and understood the brief perfectly! Quick responses developing the project and very good cooperation. I suggest to anyone.
Enquiry or Requirement
If you have more details or questions, you can reply to the received confirmation email.