I can play videos using API Player Player 1.2.2 for Android. However, users always see preview ads, even if they have a YouTube Red subscription. I could not find the documentation related to playing the video as a specific YouTube user to use the YouTube Red subscription, which disables ads.
The javadoc for YouTubePlayerSupportFragment.initialize()
says:
public void initialize (String developerKey, YouTubePlayer.OnInitializedListener listener)
Initialize YouTubePlayer, which can be used to play videos and control video playback. One of the callbacks in the listen will be called when initialization succeeds or fails.
Parameters
developerKey A valid API key that allows you to use the Data Data v3 API service. To create a new key, visit the Google Developer Console.
listener Callbacks that will be called when initialization succeeds or fails.
Thus, it uses the API key, not the OAuth user credentials. Is there a way to pass OAuth credentials instead to play the video as a specific user?
: https://github.com/youtube/yt-direct-lite-android - OAuth 2.0 , API.