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 implementation with SC.stream to avoid focus problems #262

Closed
wants to merge 2 commits into from

Conversation

SkinyMonkey
Copy link
Contributor

might not be perfect but it's a start.
difference with the previous soundcloud implementation:

  • Use of the SC.stream instead of the iframe
  • Use of SC.get to retrieve the id of the track
  • A this.state was added to rerender the component and image with setState when the artwork is loaded
  • a pSetState was added to wrap setState into a promise
  • Errors are defined by multiple events by the soundcloud event emitter
  • The data is extracted from a subobject of the player : _controller
  • The volume does not need to be divided

SDK choice :
https://connect.soundcloud.com/sdk.js is an old 2.0 version, no promises
https://connect.soundcloud.com/sdk/sdk-3.2.2.js asks for a secret_token
3.0.0 was kept

BUG FOUND:
bug found at src/Player.js : this.onPause is not given as a parameter to the active Player:
When i paused my player i could not play it back.
i noticed that the internal isPlaying variable wasn't updated.
Ultimately it was the onPause callback that wasn't passed back to
the Player in the render function.
Adding it fixed my problem

@cookpete
Copy link
Owner

What is the benefit of using the streaming SDK over the iframe widget? The title of the PR mentions "focus problems" but you haven't specified exactly what problems there are.

The library has already switched from using the SDK to the widget in the past because of issues with the client ID and rate limiting, along with the fact that signing up for your own client ID is currently unavailable.

@SkinyMonkey
Copy link
Contributor Author

SkinyMonkey commented Oct 30, 2017 via email

@cookpete
Copy link
Owner

When I play a track and the next one does not use the same provider, for
example from youtube to soundcloud, if the window is not focused at the
moment the track won't play.

Ah this is exactly what the preload config does for youtube, vimeo and dailymotion. I'll see if the same logic can be applied to the Soundcloud player.

@cookpete cookpete closed this Oct 30, 2017
@SkinyMonkey
Copy link
Contributor Author

SkinyMonkey commented Oct 30, 2017 via email

cookpete added a commit that referenced this pull request Oct 30, 2017
@cookpete
Copy link
Owner

By the way : should i open an issue for the bug i found?

No need: fixed and published in 1.0.0-beta.2, including preload support for Soundcloud.

david-hub024 pushed a commit to david-hub024/React_VideoPlayer that referenced this pull request Dec 23, 2018
david-hub024 pushed a commit to david-hub024/React_VideoPlayer that referenced this pull request May 23, 2020
albanqoku added a commit to albanqoku/react-player that referenced this pull request Feb 24, 2021
Webmaster1116 added a commit to Webmaster1116/video-player that referenced this pull request May 20, 2021
webmiraclepro added a commit to webmiraclepro/video-player that referenced this pull request 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

Successfully merging this pull request may close these issues.

None yet

2 participants