You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I load a video with cueVideo and play it, and then when it finishes, and I want to play another video with another cueVideo, the video loads fine, but I have to press the play button on the YouTube video twice for it to start, not just once. It's quite problematic. Here's my code for loading a new video :
public void changerVideoId(String newVideoId) {
if (youTubePlayerView != null) {
youTubePlayerView.getYouTubePlayerWhenReady(new YouTubePlayerCallback() { @OverRide
public void onYouTubePlayer(@nonnull YouTubePlayer youTubePlayer) {
youTubePlayer.cueVideo(newVideoId, 0); // Load the new video
videoId = newVideoId; // Update the current Video ID
}
});
}
}
Is the only solution to fix this problem to remove the YouTubePlayerView once the first video is finished and then put it back and call cueVideo again? I would prefer not to have to remove the YouTubePlayerView every time. Thank you."
The text was updated successfully, but these errors were encountered:
Thanks for your answer but I don't find a solution for my problem. I find this code but in my case, I don't want to use loadOrCueVideo because I don't want to launch the videos with a button but just cue a video when I click on the button so this code doesn't work :
When I load a video with cueVideo and play it, and then when it finishes, and I want to play another video with another cueVideo, the video loads fine, but I have to press the play button on the YouTube video twice for it to start, not just once. It's quite problematic. Here's my code for loading a new video :
public void changerVideoId(String newVideoId) {
if (youTubePlayerView != null) {
youTubePlayerView.getYouTubePlayerWhenReady(new YouTubePlayerCallback() {
@OverRide
public void onYouTubePlayer(@nonnull YouTubePlayer youTubePlayer) {
youTubePlayer.cueVideo(newVideoId, 0); // Load the new video
videoId = newVideoId; // Update the current Video ID
}
});
}
}
Is the only solution to fix this problem to remove the YouTubePlayerView once the first video is finished and then put it back and call cueVideo again? I would prefer not to have to remove the YouTubePlayerView every time. Thank you."
The text was updated successfully, but these errors were encountered: