If playing any SoundCloud URL, 2 different callbacks are called when the songs end:
onPause
onEnded
This behavior unfortunately mess up with possible controllers / auto-play Components which expects only onEnded when a song ends.
Expected Behavior
As per other type of URL (i.e. YouTube).
Only onEnded is called when the songs end.
Steps to Reproduce
Sorry but I can't seem to make the fiddle page work, so I'll paste directly the code here:
- Create ReactPlayer with e.g. YouTube URL
Scroll/wait until songs end.
Check console log.
<ReactPlayer
url="https://www.youtube.com/watch?v=oFRbZJXjWIA"
className="react-player"
playing={true}
controls
width="100%"
height="100%"
onPlay={() => console.log("onPlay")}
onPause={() => console.log("onPause")}
onEnded={() => console.log("onEnded")}
/>
- Create ReactPlayer with a SoundCloud URL
Scroll/wait until songs end.
Check console log.
<ReactPlayer
url="https://soundcloud.com/jonny-bones-jones/bob-marley-jammin"
className="react-player"
playing={true}
controls
width="100%"
height="100%"
onPlay={() => console.log("onPlay")}
onPause={() => console.log("onPause")}
onEnded={() => console.log("onEnded")}
/>
Environment
- Browser: Chrome
- Operating system: Linux
If playing any
SoundCloud URL, 2 different callbacks are called when the songs end:onPauseonEndedThis behavior unfortunately mess up with possible controllers / auto-play Components which expects only
onEndedwhen a song ends.Expected Behavior
As per other type of URL (i.e. YouTube).
Only
onEndedis called when the songs end.Steps to Reproduce
Sorry but I can't seem to make the fiddle page work, so I'll paste directly the code here:
Scroll/wait until songs end.
Check console log.
Scroll/wait until songs end.
Check console log.
Environment