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 player does not work in Safari #24

Closed
Fauntleroy opened this issue Jan 3, 2016 · 11 comments
Closed

SoundCloud player does not work in Safari #24

Fauntleroy opened this issue Jan 3, 2016 · 11 comments

Comments

@Fauntleroy
Copy link
Contributor

These two errors appear when attempting to play a SoundCloud track in Safari:

screen shot 2016-01-03 at 12 14 02 pm

@Fauntleroy
Copy link
Contributor Author

@rbarman
Copy link

rbarman commented Feb 26, 2016

+1. Is anything being done to fix this or will this component not entirely work in Safari?

@cookpete
Copy link
Owner

A possible fix would be to host a modified version of the SDK somewhere, which replaces any use of api.soundcloud.com with a purpose-built proxy, to circumvent the incorrect header errors.

That said, this would be an extravagant fix for something that seems incredibly easy to fix on Soundcloud’s backend.

@heybenji
Copy link

Is this an http/https issue?

@cookpete
Copy link
Owner

Is this an http/https issue?

@heybenji Not as far as I know. I get the same error from a https page too.

@denisflorkin
Copy link

denisflorkin commented May 13, 2016

Hello, I was a bit annoyed by the sdk not working on safari, so I tried using soundcloud-audio instead and it seems to work properly. I'd really appreciate some feedback, and if you feel there's value, I'd be happy to prep a clean PR.
Here's the code : https://github.com/denisflorkin/react-player

And here's just the "player/soundcloud.js" revisited "with soundcloud-audio" : https://github.com/denisflorkin/react-player/blob/master/src/players/SoundCloudAudio.js

soundcloud-audio => https://github.com/voronianski/soundcloud-audio.js

@cookpete
Copy link
Owner

Nice work @denisflorkin. It looks like the only reason soundcloud-audio works is that it uses JSONP (which the SC endpoint happens to support) so a much simpler fix could be just to use JSONP to make requests instead. Should be a quick fix that I'll do today.

In fact, I realise now that soundcloud-audio literally just grabs the stream_url from the resolve.json endpoint and then just sets the source of an audio element. Perhaps it would be sufficient for ReactPlayer to also do this rather than have to load the full SC SDK, especially considering it already supports files via FilePlayer.

@denisflorkin
Copy link

Thanks @cookpete. To make sure I'm following, are you saying you'd get rid of the SoundCloud entirely and repatriate its logic into the FilePlayer ? Or something (slighly) different ?

@cookpete
Copy link
Owner

cookpete commented May 19, 2016

Pretty much. SoundCloud could just extend FilePlayer and change the load function to make the resolve call, then set the player src to the track's stream_url. This would remove a lot of code and give us all the control we get when playing files (like native controls).

@denisflorkin
Copy link

I looked at it but I'm not really getting anywhere close something good, I leave it there for now as I think I need to get back in the react doc. Thanks for all the work on react-player :)

@cookpete
Copy link
Owner

I looked at it but I'm not really getting anywhere close something good

No problem, I'm happy to look at this. I'll open a new issue.

david-hub024 pushed a commit to david-hub024/React_VideoPlayer that referenced this issue Dec 23, 2018
Also removes the need for fetch polyfill
Fixes cookpete/react-player#24
Should also fix cookpete/react-player#47
@mgw-sbex mgw-sbex mentioned this issue Jan 25, 2019
david-hub024 pushed a commit to david-hub024/React_VideoPlayer that referenced this issue May 23, 2020
Also removes the need for fetch polyfill
Fixes cookpete/react-player#24
Should also fix cookpete/react-player#47
albanqoku added a commit to albanqoku/react-player that referenced this issue Feb 24, 2021
Also removes the need for fetch polyfill
Fixes cookpete/react-player#24
Should also fix cookpete/react-player#47
Webmaster1116 added a commit to Webmaster1116/video-player that referenced this issue May 20, 2021
Also removes the need for fetch polyfill
Fixes cookpete/react-player#24
Should also fix cookpete/react-player#47
webmiraclepro added a commit to webmiraclepro/video-player that referenced this issue Sep 9, 2022
Also removes the need for fetch polyfill
Fixes cookpete/react-player#24
Should also fix cookpete/react-player#47
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

5 participants