I am trying to retrieve songs from soundcloud api and use the oembed to play the songs like so:
var url = 'https://api.soundcloud.com/tracks.json?client_id=ddddea95338821004a98791d999c1118&q=park&filter=all&order=created_at';
$.getJSON(url, function(tracks){
var random = Math.floor(Math.random() * 49 );
SC.oEmbed(tracks[random].uri, {autoplay: true}, document.getElementById('wrap'));
console.log(tracks[random].title);
console.log(tracks[random].id);
});
apparently soundcloud returns a list of 50 tracks and i want to get a random track from that list, but i get the NS_ERROR_DOM_BAD_URI: Access to restricted URI denied
error on line 1 of sdk.js, which is weird because I can retrieve the id and the title of the song into the console log, what am I doing wrong?