Skip to content

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

Description

@dlime

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions