Why Chrome doesn't broadcast a song using SoundCloud API V3

I am trying to transfer a song using the SoundCloud api, but apparently it does not play in Chrome. However, it works with other browsers.

SC.initialize({ client_id: '65243ec784b284f1d8a8f950312240fa', redirect_uri: 'http://example.com/callback' }); SC.stream('/tracks/293').then(function(player) { player.play(); }); 

JSFIDDLE

Any idea to make it work in Chrome?

+2
source share
3 answers

see my solution on open the Github issue (code pasted below for convenience).

If you are using SoundManager2, then call setup when dom is ready.

Instead of using the SoundCloud api stream function, call SC.get and then create a sound object in SoundManager using createSound() , passing stream_url from the track you just captured.

 SC.get('/users/711016/tracks').then(function(tracks) { var sound = soundManager.createSound({ id: 'mySound', url: tracks[0].stream_url + "?client_id=YOUR_CLIENT_ID", stream: true }); sound.play(); }); 

I assume that the api route to the track you are trying to play may be different from mine.

+1
source

This is a known compatibility issue due to the Chrome version of Flash. There is little that can be done besides disabling Flash or playing games with different versions of the SDK to see which one works for your particular Chrome build.

0
source

As JAL said, this is unfortunately known and there seems to be no fix.

Instead of what I suggest to do is use their widget API to create a custom iFrame (you can make it invisible if you want), and then use the .load() method to load any track or tracks that you want. You can read about it here .

The widget's API is really good because it comes with a bunch of event listeners that are very useful, depending on what you are doing.

0
source

All Articles