androidyoutube-data-apiandroid-jetpack-composeandroid-youtube-api

YouTubeBaseActivity in Jetpack Compose


I want to use YouTube player from YouTubeDataAPI v3 in Jetpack Compose. But it should be extended of YouTubeBaseActivity. The main problem is that activity extended of YouTubeBaseActivity haven't composable setContent { }. Only setContentView(). Should i create another activity, extended of YouTubeBaseActivity and xml layout? Or there is another way to use it?


Solution

  • YouTubeBaseActivity extends the base Activity directly, which do not implement proper extension function. But you can work around that by using YouTubePlayerFragment. The first thing the documentation is mentioning is that while using this fragment you don't have to extend your activity from YouTubeBaseActivity