youtube player api android example
dependencies {
implementation 'com.pierfrancescosoffritti.androidyoutubeplayer:core:10.0.5'
}
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<com.pierfrancescosoffritti.androidyoutubeplayer.core.player.views.YouTubePlayerView
android:id="@+id/youtube_player_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:videoId="S0Q4gqBUs7c"
app:autoPlay="true"
app:showFullScreenButton="false" />
</LinearLayout>
For further information you can view :
https://github.com/PierfrancescoSoffritti/android-youtube-player