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

SoundCloud URL triggers "onPause" before "onEnded" when songs end #879

Closed
dlime opened this issue May 6, 2020 · 1 comment
Closed

SoundCloud URL triggers "onPause" before "onEnded" when songs end #879

dlime opened this issue May 6, 2020 · 1 comment

Comments

@dlime
Copy link

dlime commented May 6, 2020

If playing any SoundCloud URL, 2 different callbacks are called when the songs end:

  1. onPause
  2. 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:

  1. 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")}
        />
  1. 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
@dlime
Copy link
Author

dlime commented May 24, 2020

Thx for the fix ✌

Webmaster1116 added a commit to Webmaster1116/video-player that referenced this issue May 20, 2021
webmiraclepro added a commit to webmiraclepro/video-player that referenced this issue Sep 9, 2022
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

1 participant