Skip to content

An error occured. Please try again later #1147

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

Open
mfrizki1 opened this issue May 27, 2024 · 6 comments
Open

An error occured. Please try again later #1147

mfrizki1 opened this issue May 27, 2024 · 6 comments
Labels

Comments

@mfrizki1
Copy link

I have a problem when play the video.
version: 12.1.0

Case :
when first time open the app, the video will start normally in fragment, but after go to another activity/fragment and come back to the fragment video player the video cannot to play. The message is An error occured. Please try again later. After i kill the app, the video start normally again.

@mfrizki1 mfrizki1 added the bug label May 27, 2024
@mfrizki1
Copy link
Author

When i override fun onError(youTubePlayer: YouTubePlayer,error: PlayerConstants.PlayerError).
error : INVALID_PARAMETER_IN_REQUEST

@PierfrancescoSoffritti
Copy link
Owner

Please provide a code sample, or try to replicate in the sample app.

@mfrizki1
Copy link
Author

My code just like this

in fragment:
image
when first time open the fragment, video start normally

but after go to another activity/fragment, it goes to onError method with error : INVALID_PARAMETER_IN_REQUEST

image

@PierfrancescoSoffritti
Copy link
Owner

Can you double check that the video ID you're providing the second time is correct?

@MahmoudMabrok
Copy link

@mfrizki1 you can also try to use fixed id, and check if issue occurs or not.

if occurs, might data been lost between transition

@FFMCloser
Copy link

FFMCloser commented Oct 12, 2024

Good morning, maybe you have already solved it, but for anyone else who came here, we have face with the same situation and the problem was that the player don't initialize on time when we do the code as you (let the initialization be done automatically and only add an AbstractYouTubePlayerListener in order to know when the player is ready).

To solve the problem, we have:

  • change in the xml (or in code) to app:enableAutomaticInitialization="false"
  • Initialize the player "manually"
    youtubePlayerView.initialize(object : AbstractYouTubePlayerListener() {
    override fun onReady(youTubePlayer: YouTubePlayer) {}
    .....
    }

This solves the problem for us.

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

4 participants