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

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?

1 Like

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

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.

2 Likes

Sure, that page is here :wink:

https://discourse.org/buy

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

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

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

https://developers.soundcloud.com/docs/oembed#introduction

Seems to imply that either url is ok. strange.

They work for me.

http://tests.testeleven.com/t/test-topic-for-soundcloud-onebox/25

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

Thanks!

You need to whitelist the domain.

2 Likes

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

Is this a set?

https://soundcloud.com/simoncossar/sets/test-playlist

Both of the above examples are now working.

@techapj make sure soundcloud is whitelisted by default.

2 Likes

Awesome thanks @Simon_Cossar !

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:

4 Likes

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

4 Likes

That’s excellent! :+1:

I made the similar changes in core Discourse SoundCloud onebox:

3 Likes