Open SourabhBhatt761 opened 1 year ago
Could it be that you're passing the wrong video id programmatically? Please have a look a the sample apps for how to use the library programmatically.
No, the video id was correct as I said it was working with the xml.
I've added another lister which is
youTubePv.getYouTubePlayerWhenReady(youTubePlayer -> {
String videoId = videoList.get(0);
Log.i(TAG, "onReady");
Log.i(TAG, "video id -> " + videoId);
youTubePlayer.loadVideo(videoId, 0);
setYouTubePlayerTracker(youTubePlayer);
});
And now it's working fine as expected. Thanks.
I see. Try setting enableAutomaticInitialization
to false, in the xml.
Hi,
Please refer to the following code, there's no change from the code mentioned in the readme.
onReady isn't called even though YouTubePlayerView has been initialized properly. I see the black screen with the YouTube icon and if I click on it I get the error
INVALID_PARAMETER_IN_REQUEST
.Note:- with the XML if I use app:videoId="S0Q4gqBUs7c" app:autoPlay="true", the video starts playing perfectly.
Library version:- 11.1.0
Devices:- Vivo , android version 11 Oneplus 11 , android version 12