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

autoplay after onEnd #36

Closed
ioRekz opened this issue Jan 28, 2016 · 4 comments
Closed

autoplay after onEnd #36

ioRekz opened this issue Jan 28, 2016 · 4 comments

Comments

@ioRekz
Copy link

ioRekz commented Jan 28, 2016

I'm trying to play the next song when one is finished.

I've added this to the onEnded prop but it only triggers when tab gain focus again.
The component is not created again, the iframe is not recreated.

This should work since the latest updates right ?
I'm only trying on localhost (just stating in case chrome is allowing iframe on specific domain)

@cookpete
Copy link
Owner

Hey @ioRekz, I'm assuming you are having this problem with the YouTube player. Have you tried using the preload prop? This should fix the problem you are describing:

<ReactPlayer
  url='https://www.youtube.com/watch?v=nySZH0tcL9I'
  youtubeConfig={{ preload: true }}
/>

See the original PR for more details.

@ioRekz
Copy link
Author

ioRekz commented Jan 29, 2016

same result so far.
I only use youtube videos.
I'm also using the minified version from the library branch. Based on the PR details it could come from minification but I can't try the dev version.

I was thinking that the onEnd callback could not be called when the tab is not focus but it is.
The video plays again as soon as the tab gains focus again.

@cookpete
Copy link
Owner

@ioRekz could you post some code or an example repo where this happens? Or just some more detailed steps to reproduce the problem.

@cookpete
Copy link
Owner

Closing this due to age. Feel free to re-open with steps to reproduce the issue.

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

No branches or pull requests

2 participants