# How can I automatically embed a Bandcamp player on my site?

**URL:** <https://meta.discourse.org/t/how-can-i-automatically-embed-a-bandcamp-player-on-my-site/255579>\
**Category:** Development\
**Tags:** unsupported-install, embedding\
**Created:** [February 18, 2023, 10:49pm UTC](https://meta.discourse.org/t/how-can-i-automatically-embed-a-bandcamp-player-on-my-site/255579 "2023-02-18T22:49:33Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![merefield](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/merefield/32/176214_2.png) [@merefield](https://meta.discourse.org/u/merefield)\
**Post date:** [February 19, 2023, 9:58am UTC](https://meta.discourse.org/t/how-can-i-automatically-embed-a-bandcamp-player-on-my-site/255579/4 "2023-02-19T09:58:13Z")

</div>

As Jay pointed out you should look at the source code.

‘Onebox’ is the library that, in part, converts some URLs into embeds.

Have you looked at?:

> <https://github.com/discourse/discourse/blob/64171730827c58df26a7ad75f0e58f17c2add118/lib/onebox/engine/band_camp_onebox.rb>

I think the original intention was that this code be also used on non-Discourse sites.

To that end there’s a (now unmaintained) gem that you might be able to leverage (assuming your site is RoR), maybe you’d be interested in maintaining it?

[https://github.com/discourse/onebox](https://github.com/discourse/onebox)

A word of caution: the code on Discourse will have positively evolved since.

---

_[View the full topic](https://meta.discourse.org/t/how-can-i-automatically-embed-a-bandcamp-player-on-my-site/255579)._
