1

I am using the following code to attempt to stream a soundcloud track in an html page, and it continues to fail (error code 403). The documentation is vague, and most of the discussion regarding how to work with the soundcloud api are a few years old.

var soundcloud = require('soundcloud');
soundcloud.initialize({
    client_id: 'MYCLIENTID'
});

const _sc_track_id = "tracks/986824216";

soundcloud.stream(_sc_track_id).then(function(player){
    player.play().then(function( ) {
        console.log('Playback started!');
    }).catch(function(e){
        console.error('Playback rejected. Try calling play() from a user interaction.', e);
    });
});

I would like to stream a track using my own client id on a webpage. What is the expected way to play a track from soundcloud in a webpage?

rdurnin
  • 31
  • 4

1 Answers1

0

Unfortunately, it looks SoundCloud stopped supporting its public API. The current work around is mentioned in this answer.

pierre
  • 151
  • 8