![]() ![]() If not set, the player won't automatically play. If set, the player will automatically start playing the video. This attribute expects a String, which is the id of a YouTube video. Everything can also be done programmatically. If you add the view to your XML layout you have the possibility to set a few custom attributes, to customize the view's look and behavior. If the height of the View is set to wrap_content, the View will automatically have an aspect ratio of 16:9, to match the aspect ratio of most YouTube videos. YouTubePlayerView youTubePlayerView = new YouTubePlayerView( this) It's all you need to play YouTube videos in your app.Īdd this to your module level adle file. The core module contains the YouTube Player. The minimum API level supported by this library is API 17. The Gradle dependency is available via MavenCentral. □ If you want to know when a new release of the library is published: watch this repository on GitHub. Download apk of chromecast-sender sample app.□ You can also download and install the apks of both sample apps. Go to source code of chromecast-sender sample app.□ Both the core module and the chromecast module have a sample app, to provide examples of usage of the libraries. Remove views that cannot be removed by the controls parameter.This issue has nothing to do with the library itself, but I figured it may be useful knowledge for many of you considering to use it. If you follow the instructions in the documentation, the library will automatically handle this for you.Īlso remember when publishing your app on the PlayStore to write title and description in a way that makes it obvious that your app doesn't have any affiliation with YouTube (the company). ![]() That said how you use the library matters, be sure to play videos only when the player is visible. Playing YouTube videos in a WebView is the recomended approach by Google, both on Android and iOS. Therefore it is 100% compliant with terms of service. The library uses YouTube's own web player to play videos. This will enable me to continue developing the library, so you don't have to.ĭoes this library break YouTube terms of service? If you choose to use this library and profit from it, consider informing me and become a sponsor on GitHub. Used by over 5 thousands apps, with some big names like Tumblr, Flipkart, McDonald's, InShot Video Editor, Genius and reddit is fun. Now that the official API from Google is deprecated, android-youtube-player is the main YouTube player library for Android. Google now recommends using the IFrame Player API inside a WebView, which is exactly what this library does, while also providing a native Java/Kotlin interface to interact with the web player.Ī lengthier explanation of why this library was created can be found in this Medium post. ![]() ![]() This library has been historically not reliable and is now deprecated by Google. The library provided by Google is the YouTube Android Player API. This library also provides a Chromecast YouTube player, that you can use to cast YouTube videos from your app to a Chromecast device. Therefore there are no issues with YouTube Terms of Service. The library is a wrapper around the IFrame Player API, which runs inside of a WebView. It provides a simple View that can be easily integrated in every Activity/Fragment. Android-youtube-player is a stable and customizable open source YouTube player for Android. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |