As a follow-up to Play playlist or track by permalink not trackid: the solution provided works fine seemingly everywhere except Safari on Mac.
On the Safari on Mac we s
You can try using the JSONP approach. Here's an updated fiddle using JSONP instead of XMLHttpRequest. The main difference is in the getSoundCloudId()
method and the addition of a global jsonpResponse()
method.
function getSoundCloudId(permalink) {
var jsonp = document.createElement('script');
var script = document.getElementsByTagName('script')[0];
jsonp.type = 'text/javascript';
jsonp.async = true;
jsonp.src = 'http://api.soundcloud.com/resolve.json?client_id='+CLIENT_ID
+ '&url='+permalink+'&callback=jsonpResponse';
script.parentNode.insertBefore(jsonp, script);
return false;
}