Skip to content

Instantly share code, notes, and snippets.

@pikesley
Last active August 29, 2015 14:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pikesley/33991c36bcf4ed79421b to your computer and use it in GitHub Desktop.
Save pikesley/33991c36bcf4ed79421b to your computer and use it in GitHub Desktop.
How do I SoundCloud?

I am mildly bewildered by SoundCloud embeds. I have this page on my band's (Github-hosted) site. Right now, it's using this hacked-together thing to embed those tracks, which is a bit inelegant but works on everything I've tried it on, including various phone browsers.

In an attempt to create a more beautiful solution, I tried using the oEmbed endpoint with this (with the initializer here) which works fine on my desktop browsers, and in Chrome on my Android phone. But on other phone browsers none of the tracks get rendered, unless I request the desktop version, which makes it all work fine (at least on the Android browser, I've had semi-confirmed reports of it working on iPhones too). See it in action here.

I'm presuming this is all some horrible nexus of User-agents, HTML5 and Flash, and maybe I'm doing something dumb (I'm cargo-culting most of this JavaScript stuff) but is there a nice way out of this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment