react-player icon indicating copy to clipboard operation
react-player copied to clipboard

No autoplay next video, when tab doesn't have focus.

Open tkaryadis opened this issue 2 years ago • 4 comments

I want to make a playlist, when one song ends to auto-play the next. I use youtube links.

I use "onEnd", i change the state that "url" reads, i use simple string a signle URL. If tab has the focus its working fine. If tab doesn't has the focus, video plays until the end, but doesn't start the next.

This is happening in chrome/brave/chromium, on firefox it works even if tab doesn't have the focus. I use ubuntu and Chromium Version 117.0.5938.88 (Official Build) snap (64-bit)

tkaryadis avatar Sep 21 '23 12:09 tkaryadis

Can you please share the video bug report for this?

CoHarsh avatar Sep 24 '23 15:09 CoHarsh

Can you please share the video bug report for this?

I am sorry but i don't know what you need the bug is not related with specific video i use youtube player, i use a simple string as url (not an array), and try to make a playlist, where i detect when video ends to play the next(change the url to another string), works only if tab has the focus.

If i make the url an array of strings(array of urls) playback is working even if tab doesn't have focus, but then i have other problems, like onEnd works only if all urls end(all playlist), everytime that the playlist changes i have to update the url of the player etc. Maybe the problem is not related with react-player, and its just default browser behaviour for perfomance/memory.

In any case because i am new to react-player, if someone can help on how i can play a playlist that dynamically changes and continues to play/move to next, when tab is not focused it will help me.

tkaryadis avatar Sep 24 '23 19:09 tkaryadis

Could you create an app with codesandbox or something to make it easy for us to replicate the error?

walteraandrade avatar Oct 27 '23 18:10 walteraandrade