Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem when I want cueVideo after a cueVideo #1111

Open
Tino-perf opened this issue Feb 12, 2024 · 0 comments
Open

Problem when I want cueVideo after a cueVideo #1111

Tino-perf opened this issue Feb 12, 2024 · 0 comments
Labels

Comments

@Tino-perf
Copy link

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."

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant