Analysis updated 2026-07-03
Embed a YouTube video player in an Android screen with just a few lines of Kotlin, handling lifecycle and pause-on-scroll automatically.
Let users cast YouTube videos from your Android app to a Chromecast device using the included Chromecast extension.
Replace a deprecated Google YouTube Android Player API integration in an existing app with a compliant, maintained alternative.
Listen to playback state changes like playing, paused, or ended to sync your app's UI with the video player.
| pierfrancescosoffritti/android-youtube-player | gradle/kotlin-dsl-samples | bufferapp/android-clean-architecture-boilerplate | |
|---|---|---|---|
| Stars | 3,691 | 3,687 | 3,686 |
| Language | Kotlin | Kotlin | Kotlin |
| Setup difficulty | easy | easy | moderate |
| Complexity | 2/5 | 2/5 | 3/5 |
| Audience | developer | developer | developer |
Figures from each repo's GitHub metadata at analysis time.
Requires Android API level 21 or higher, Chromecast support is a separate optional module.
android-youtube-player is an open-source library for Android developers who want to add YouTube video playback to their apps. It was created because Google's own YouTube Android Player API was unreliable and has since been officially deprecated. Google now recommends the IFrame Player API approach, which embeds YouTube's own web player inside a WebView, and this library does exactly that while providing a clean Java and Kotlin interface so developers do not have to work with the web layer directly. Because the library uses YouTube's own web player internally, it is compliant with YouTube's terms of service. Playing videos through a WebView is the method Google recommends on both Android and iOS. Adding a YouTube player to an Android screen involves placing a YouTubePlayerView in your layout and initializing it with a listener. The listener gives you callbacks for when the player is ready, when playback state changes (playing, paused, buffering, ended), and other events. From there you can load videos by their YouTube ID, seek to positions, and control playback. The library automatically pauses playback when the player goes off screen, which is required by YouTube's terms of service. It also handles Android lifecycle events if you register it as a lifecycle observer. The library includes Chromecast support as a separate extension module. This lets users cast YouTube videos from an Android app to a Chromecast device. The Chromecast extension covers both the sender side (the Android app) and a receiver page that runs in the browser on the Chromecast. The library has been integrated into over 5,000 Android apps, including Tumblr, Flipkart, McDonald's, and others. Minimum supported Android API level is 21. The full README is longer than what was shown.
An Android library that adds reliable YouTube video playback to your app using YouTube's own web player, replacing Google's deprecated official API.
Mainly Kotlin. The stack also includes Kotlin, Java, Android.
License terms are not described in the explanation.
Setup difficulty is rated easy, with roughly 30min to a first successful run.
Mainly developer.
This repo across BitVibe Labs
Verify against the repo before relying on details.