-
Notifications
You must be signed in to change notification settings - Fork 111
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 on custom stream urls? #88
Comments
Running into same issue. Can't figure it out. |
Figured it out. I manually triggered a click event on the button. |
Hi! I have the same issue; I have not been able to use autoplay on a custom url. |
Hello, Any update? |
Any update? |
Workaround: set a global let autoplay = true;
const SoundcloudPlayer = withSoundCloudAudio((props) => {
const { soundCloudAudio, playing, track } = props;
if (track && autoplay) {
soundCloudAudio.play();
autoplay = false;
}
// other code goes here
}); |
@davalapar, I would change the global to a flag on the component instance (this.autoplay), since multiple instances on the same page, or different pages that should keep auto playing would be affected by the one global. It could need a higher state manager though since only one player should auto play etc. Another fix is to, toggle the flag back to true on unmount. |
Hi,
great plugin!
Is there a way to autoplay a custom track once the player has been mounted?
Thanks
David
The text was updated successfully, but these errors were encountered: