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

Questing: Playing same song multiple times

Open brothell opened this issue 9 years ago • 1 comments

Hello,

i'm making something like "playlist" functionality, but when 2 song in row are the same the second song will not be played automaticaly. Maybe because nothing changed in state? Is there way to start it playing?

Thanks Boris

brothell avatar May 17 '17 16:05 brothell

You are correct that if you try to "play" the currently playing URL, the props don't change and so nothing happens. This is an unfortunate downside in the declarative nature of how ReactPlayer listens to changes in props.

One thing you could do is, at the point where you load a song, check if it is the same as the previous URL and run seekTo(0) if so.

cookpete avatar May 17 '17 19:05 cookpete