How to embed Bandcamp players
Status
Not open for further replies.
Aug 2, 2014 at 2:22 PM Thread Starter Post #1 of 8

Music Alchemist

Pokémon trainer of headphones
Joined
Dec 17, 2013
Posts
20,092
Likes
2,299
Does anyone know if it is possible to embed Bandcamp players here?
 
It would be so much simpler (and better-sounding) to embed those from official sources instead of shoddy YouTube links.
 
Aug 2, 2014 at 4:14 PM Post #2 of 8
<iframe style="border: 0; width: 100%; height: 42px;" src="http://bandcamp.com/EmbeddedPlayer/album=4282593560/size=small/bgcol=ffffff/linkcol=0687f5/transparent=true/" seamless><a href="http://jessevalentinemusic.bandcamp.com/album/like-a-sir">Like A Sir by F-777</a></iframe>
 
That is an example embed for HTML. Unfortunately, you cannot use HTML in posts here, so that will just show up as text.
 
Edit: I'm not at all familiar with this forum software, but it may be possible for a forum admin to add a forum code where you put the embed link (http://bandcamp.com/EmbeddedPlayer/album=4282593560/size=small/bgcol=ffffff/linkcol=0687f5/transparent=true/) and it will embed it without having to enable html.
 
Aug 2, 2014 at 5:46 PM Post #3 of 8
  <iframe style="border: 0; width: 100%; height: 42px;" src="http://bandcamp.com/EmbeddedPlayer/album=4282593560/size=small/bgcol=ffffff/linkcol=0687f5/transparent=true/" seamless><a href="http://jessevalentinemusic.bandcamp.com/album/like-a-sir">Like A Sir by F-777</a></iframe>
 
That is an example embed for HTML. Unfortunately, you cannot use HTML in posts here, so that will just show up as text.
 
Edit: I'm not at all familiar with this forum software, but it may be possible for a forum admin to add a forum code where you put the embed link (http://bandcamp.com/EmbeddedPlayer/album=4282593560/size=small/bgcol=ffffff/linkcol=0687f5/transparent=true/) and it will embed it without having to enable html.

 
What's interesting is that when you paste the embed code into the post source code, the player shows up...but when you submit the post, it only displays a link to the Bandcamp page.
 
Head-Fi uses the Huddler platform, which doesn't seem to be compatible - but I'm not giving up just yet!
 
Then again, Bandcamp's player usually relies on iframe, and that type of code is a security nightmare...
 
Oh well. I guess I'll just post the plain old links when I want someone to hear something on Bandcamp.
 
Feb 23, 2016 at 9:51 AM Post #4 of 8
I know this was from a while ago @Music Alchemist, but I've been looking into it again just recently as it's still an issue. The <a></a> tags aren't actually required between the iframe tags - this is just for browsers that don't support frames; browsers that support frames won't show any content placed between iframe tags. Nevertheless, the submitted code still doesn't display. My guess is that there may be some kind of server-side XSS security checks going on when the page is loaded, preventing it from being displayed - it's often used to detect attempts to inject malicious scripts in frames.
 
What I don't get though is that SoundCloud embedding works OK, and that also uses frames. For example:
 
BC:
 
<p><iframe style="border: 0; width: 100%; height: 120px;" src="https://bandcamp.com/EmbeddedPlayer/album=3160808044/size=large/bgcol=ffffff/linkcol=0687f5/tracklist=false/artwork=small/transparent=true/"></iframe></p>
 
SC:
 
<iframe width="100%" height="200" scrolling="no" frameborder="no" src="https://w.soundcloud.com/player/?url=https%3A//api.soundcloud.com/tracks/245794504&amp;auto_play=false&amp;hide_related=false&amp;show_comments=true&amp;show_user=true&amp;show_reposts=false&amp;visual=true"></iframe>
 
Entering the SC code in the editor's 'Source' mode works fine, while the BC code does not, despite the fact they both use frames.
 
Input from an admin on the dev side would be helpful.
 
Feb 23, 2016 at 10:20 AM Post #5 of 8
  My guess is that there may be some kind of server-side XSS security checks going on when the page is loaded, preventing it from being displayed - it's often used to detect attempts to inject malicious scripts in frames.

 
That's it exactly. Many forums are restrictive in what code is allowed, for security purposes.
 
Linking to Bandcamp pages is good enough, though. Just gotta do slightly more convincing to get people to press play.
 
Feb 23, 2016 at 10:29 AM Post #6 of 8
Sure. I'm just curious to know why the embedded SC player is OK, while BC isn't, given that the embedded code uses frames in both cases. I'd be interested to know the reason why, if someone could explain the discrepancy.
 
Feb 23, 2016 at 10:46 AM Post #7 of 8
  Sure. I'm just curious to know why the embedded SC player is OK, while BC isn't, given that the embedded code uses frames in both cases. I'd be interested to know the reason why, if someone could explain the discrepancy.

 
It's probably just background scripts running on the site that only allow certain sites. But since Bandcamp is so popular, they should allow it sooner or later.
 
Status
Not open for further replies.

Users who are viewing this thread

Back
Top