Is there a trick to make the onebox for soundcloud sets work?


(Adrian D'atri Guiran) #1

For example:

It shows up over on the right in the preview ->>>
but doesn’t show up in the actual post. just shows as a link?

(Jeff Atwood) #2

I don’t know if sets are supported for oneboxing at the moment. Just individual tracks / songs.

(Adrian D'atri Guiran) #3

Thanks for the quick reply. Could you point me towards where i should look if i wanted to tinker a bit to get this work? this is extremely important for my forum, which is music based and mostly sharing sets and tracks from soundcloud.

(Jeff Atwood) #4

Sure, that page is here :wink:

Or, you could contribute an improvement to the oneboxer gem GitHub - discourse/onebox: A gem for turning URLs into website previews

(Adrian D'atri Guiran) #5

Willing to throw some money your way, but not interested in buying any sort of monthly hosting plan. I’m fine hosting it myself.

(Adrian D'atri Guiran) #6

Nothing in this immediately screams out to me as to why soundcloud sets would work any differently than tracks.

Seems to imply that either url is ok. strange.

(Simon Cossar) #7

They work for me.

(Adrian D'atri Guiran) #9

Work on your copy of discourse, but not on, so where is the difference? Are you on an older version? Modified version? Are you using discourse docker or manual install?


(Simon Cossar) #10

You need to whitelist the domain.

(Régis Hanol) #11

I just whitelisted it here on meta, and the onebox is “empty”. So it’s definitely not working for sets.

(Simon Cossar) #12

Is this a set?

(Stephen) #13

Both of the above examples are now working.

(Jeff Atwood) #14

@techapj make sure soundcloud is whitelisted by default.

(Adrian D'atri Guiran) #15

Awesome thanks @Simon_Cossar !

(Arpit Jalan) #16

SoundCloud is whitelisted by default, but we recently implemented custom SoundCloud onebox engine which decreases the height of default (giant) Soundcloud onebox embed.

The SoundCloud list was not getting oneboxed because the custom engine was unable to modify the height of the oembed HTML, hence gsub was returning nil. Just fixed this via:

Thanks for bringing this issue in our notice @Adrian_D_Atri_Guiran :+1:

(Simon Cossar) #17

By changing the ‘visual’ parameter for the iframe source from ‘true’ to ‘false’ it is possible to get this view for tracks:

and this view for sets:

I have a plugin for it here: soundcloud-onebox/plugin.rb at master · scossar/soundcloud-onebox · GitHub

(Arpit Jalan) #18

That’s excellent! :+1:

I made the similar changes in core Discourse SoundCloud onebox: