1

Running Soundcloud stratus player on www.naturesoundmap.com

The vast majority of listings (custom post type) work fine, but if you navigate on the map down to New Zealand (or the island of Niue), there are a few listings where in the last two weeks or so the sounds have stopped playing. eg. http://www.naturesoundmap.com/listing/post-office-bay/ & http://www.naturesoundmap.com/listing/aroha-evening/

I've checked the links & all are ok - you can see this by pressing the 'Listen' button & the track information loads up ok in Stratus, but it doesn't play.

Strangely, two of the sounds which weren't working last week are now fine.

I'm puzzled!

user3261922
  • 15
  • 1
  • 3

1 Answers1

0

The problem is that the songs have streaming diabled.

Artists on SoundCloud can choose whether to allow external streaming form sites. In the case of say

https://soundcloud.com/naturesounds_nz/aroha-island-crickets

which is one of the songs that does not play, if get it's api return

https://seam.li/json/?url=api.soundcloud.com/tracks/88830021.json?client_id=apigee

(I passed this through a site I run in order to make the json more readable, this is the plain link )

In this json we see the property

"streamable": false

on line 13, and as such it does not have the stream_url property. Therefore when you call stratus using stream_url, since it does not exist undefined is returned. this results in

GET http://stratus.sc/undefined?consumer_key=xxx 404 (Not Found)

Your solution is simply to manually check the soundcloud urls if they are streamable before putting them on your site. Alternatively if the process is automatic just check the streamable property of the song.

Liam Bigelow
  • 789
  • 7
  • 15
  • Thanks Liam. I contacted the owner of the sound and confirmed that was the problem. All working now - appreciate your help! – user3261922 Feb 03 '14 at 01:58
  • Hi Liam, I have the same problem but the track is streameable, as you may see from here: http://api.soundcloud.com/tracks/147078202.json?client_id=apigee Is there any other thing to consider? – franz976 Jan 15 '15 at 07:46
  • 1
    Known bug that I have encountered where certain tracks on SoundCloud will have the streamable boolean set to true, yet are unable to be streamed. The bug is that they should be listed as `streamable: false` but for one reason or another they are not. This was a big problem for me, and SoundCloud is aware of this bug but won't can't fix it. http://pastebin.com/raw.php?i=7grrkBp3 This is the email response I got for this exact issue. Unfortunately you're just going to have to deal with it/work around it I'm afraid. Nothing that than be done. – Liam Bigelow Jan 17 '15 at 00:51
  • I'm having the same issue with a track having streamable: true, yet not being able to be streamed. https://api.soundcloud.com/tracks/201041378/streams?client_id=apigee. The problem is, that once a user clicks play on a broken track like that, any subsequent clicks to play valid working tracks cause the SC javascript to throw an exception. I think it bombs out on something related to setVolume...? Any ideas about how to work around this in SDK v3? – Anthony Feb 22 '16 at 17:31
  • The exception is 'Error: Error: An invalid exception was thrown. at Error (native) at i.setVolume (https://connect.soundcloud.com/sdk/sdk-3.0.0.js:12:8154' when trying to play a working track, after the supposedly streamable track breaks things – Anthony Feb 22 '16 at 17:38