Better audio oneboxing

(Jeff Atwood) #1

Continuing the discussion from File upload support?:

(Jeff Atwood) #2

Well, for audio we hope SoundCloud oneboxing works:

(Doug Moore) #3

This certainly shouldn’t prevent anyone else from looking at it, but I was going to try to toy with a generic mp3 one. I just might write some crappy ruby code in the process because I haven’t touched it in probably 5 years.

If I were to use an external js, such as SoundManager2 (which I believe SoundCloud uses), what would be the proper way to include js for a onebox?

(Sam Saffron) #4

see the onebox dir, essentially it would be done in two parts, you would probably add your component in jsapp/components then you would fire it inline using your onebox (or amend the composer to have a post hook after it brings in a good onebox)

Very little ruby code needed for this.

(Doug Moore) #5

I’ve done a onebox that required just html and ruby. It’s the .js from an external library that I wasn’t sure about.

(Doug Moore) #6

What I do notice is assets/javascripts/external – should I put it there, for instance, and then figure out how to include it?

(F. Randall Farmer) #7

This is nice, but took alot more work than embedding an .mp3 sample should. Drag-n-drop is what I want. Discourse has me lovin’ it…

[Ahh! To get it to onebox I had to https: -> http: We should probably fix that.]

(Jeff Atwood) #8

You have to turn on embedding in your SoundCloud account as I recall. None of your clips you upload are public by default. I wrote this up a while ago:

(F. Randall Farmer) #9

It was public already. The problem was that the link supplied is httpS: not http: - we should probably deal with that more gracefully, since it is what soundcloud supplies as a cut/paste link.

Oh, and since they do their own shortening, we should accept their shortcode as well.

(Jeff Atwood) #10

Should work now

(Jeff Atwood) #11