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. I don't find any solution in the sample app. 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:
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. I don't find any solution in the sample app. 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: