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

The very first youtube playlist plays, any other playlist next after it doesn't load #1765

Open
zoltes opened this issue Mar 19, 2024 · 1 comment

Comments

@zoltes
Copy link

zoltes commented Mar 19, 2024

Current Behavior

Any youtube playlist I try to play right after another playlist does not load

Expected Behavior

I play a playlist. I submit a link with another playlist, I'd like the new one to be loaded and played instead of the previous one.

Steps to Reproduce

  1. https://cookpete.github.io/react-player/
  2. Press "Playlist" in the Youtube section.
  3. Watch it's been loaded
  4. Paste a link to another youtube playlist in the Custom URL section (First example, https://www.youtube.com/watch?v=1qB6XdAkkAo&list=RDCLAK5uy_m_h-nx7OCFaq9AlyXv78lG0AuloqW_NUA&start_radio=1)
  5. Watch the new playlist doesn't load and the old one starts playing once again

Environment

Other Information

@CXZ7720
Copy link

CXZ7720 commented Jun 11, 2024

I have same problem lite this.

I think it's because this package seems to using Youtube IFrame API's loadPlaylist method. (Docs)

if (MATCH_PLAYLIST.test(url)) {

In this file, parsePlaylist() method returns same shape of object that Youtube's method consume.(object type) but this package doesn't have "index" key. Thats why it always points to first video.

However, even though if we provide the index key to return value, Youtube API doesn't play exact video what we provided through video id but play the nth index of video from playlist. Here's description of how index parameter works.

The optional index parameter specifies the index of the first video in the playlist that will play. The parameter uses a zero-based index, and the default parameter value is 0, so the default behavior is to load and play the first video in the playlist.

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