Question

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!

Was it helpful?

Solution

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top