Post by theonetwoeq on Dec 28, 2016 18:48:05 GMT -8
I've searched the Plug-In Library and the Help forums for any mention of a Bandcamp embedded player plug-in. Does anyone know if there is one available and if not, anyone willing to create one?
If all you want to do is embed the audio for playback inside a post then this looks to be possible without the need for any plugin in the current version of the software.
grab the url of the mp3 file
note: I am not familiar with bandcamp and had not heard of it until 10 minutes ago when I read this so there maybe a difference in the format of the url presented to the user and the way I grabbed it which was directly from an <audio> tag
use the insert video button -
paste the url then at the end add a hash and the webm extension so it gets treated as webm file, for example https://popplers5.bandcamp.com/download/track?enc=mp3-128&fsig=a4f4f44e49e2d31609c833e0bd592dc2&id=1255704534&stream=1&ts=1483238798.0#.webm
Every day, coders are looking for new ways to kill bugs. Think you've got what it takes?
"To fight the bug, we must first understand the bug. "
That's cool we can already to this! Very useful. I doubt users will be clever enough to know how to do this on their own though. Is there not a way to simplify it somehow for them?
Post by theonetwoeq on Feb 25, 2017 18:04:57 GMT -8
Thanks for the work around Chris; however, it will be a little cumbersome for users. On BandCamp's desktop site, it has embed options that make sharing projects easy. It embeds a player (you have options to embed a full player with all tracks visible or more streamlined embeds). The nice things about their embeds is it gives users access to all tracks in the project vs 1 and it also allows you to click through to the BandCamp page to explore the artist further.
I've tried everything I can to work around and make their embed code work on these forums to no avail. If someone would create one, that would be fantastic and much appreciated!
Last Edit: Feb 25, 2017 18:05:52 GMT -8 by theonetwoeq
Post by Former Member on Mar 2, 2017 15:07:36 GMT -8
You could in theory(I have not tried/tested) listen for a "paste" event on the ".editor textarea" then fetch the iframe from the clipboard, the code below is not complete but it might give you a push in the right direction.
This is just off the top of my head so it may be buggy, I have done zero validation or error checking so just be aware of that
$('.editor textarea').on('paste', function(e){
// grab the original event(clipboardEvent) // and its context, // so whatever was last copied to the clipboard, ie: // the bandcamp iframe // var clipBoard = e.originalEvent .clipboardData .getData('Text');
// grab the value currently in the textarea // so we can append to it // var textarea = $(this).val();
// split up the iframe into chunks so we can get it to post correctly // do do this, we break it up into an array and wrap it in a [noparse] tag // followed by a [code] tag with a class to reference it later in the DOM // // Here we split the iframe by its attributes (src|style) // which will give us an array as follows // // [ // "<iframe>", // "style="...", // "src="..."", // "<a>...<a/></iframe>" // ] // var iframe = clipboard .split(/(style="\w.+")\s+(src="\w.+")/gi) .splice(1,3);
// Next, remove the first element ["<iframe />"] // and format the anchor/link a little better // by removing the carrage returns and iframe closing tag // var link = iframe[2] .split(/\r/)[1] .replace('</iframe>', '') .trim();
iframe[2] = link;
// Build out the [noparse] tag // so we can save the data as text // and append it back into the textarea // var noparse = "[noparse][code class='band-camp-embeded']["+ iframe[0]+"]["+ iframe[1]+"]["+ iframe[2]+"][/noparse]";
// // // var html = textarea += noparse;
$(this).val(html);
} [/code]
That might get you started in the right direction. Once it gets posted, you will be able to see it on the page, you will then need to parse it and build the proper iframe with the information on-screen.
Last Edit: Mar 2, 2017 16:34:10 GMT -8 by Former Member
If all you want to do is embed the audio for playback inside a post then this looks to be possible without the need for any plugin in the current version of the software.
grab the url of the mp3 file
note: I am not familiar with bandcamp and had not heard of it until 10 minutes ago when I read this so there maybe a difference in the format of the url presented to the user and the way I grabbed it which was directly from an <audio> tag
use the insert video button -
paste the url then at the end add a hash and the webm extension so it gets treated as webm file, for example https://popplers5.bandcamp.com/download/track?enc=mp3-128&fsig=a4f4f44e49e2d31609c833e0bd592dc2&id=1255704534&stream=1&ts=1483238798.0#.webm
MAN... I have been searching for a way to embed mp3 files into a post forever. I don't understand why this seems to be such a secret or even been made into a plugin for scrubs such as myself?!
MAN... I have been searching for a way to embed mp3 files into a post forever. I don't understand why this seems to be such a secret or even been made into a plugin for scrubs such as myself?!
There has always been a companion AUDIO tag ( ) to the current VIDEO tag that was added when Proboards version 5 was introduced to the world. It was however played down because at the time there were a frenzy of copyright lawsuits being filed by the recording industry against sites and even individual users and it made sense not to push the issue (disclaimer: my own perception and conclusions of how things transpired, no official PB statement was ever put out to my knowledge)
The AUDIO tag is basically the same as above but without the need for the webm hack.
Post by SailorEffinMoon on Dec 9, 2017 10:25:43 GMT -8
Let me see if I have this right. I tried this [audio src="https://files.catbox.moe/g9tiu1.mp3" controls="controls"] it does show up in the "preview" but once I create the post it's blank.
I mean, what I got from your post was that this code should work it's just not talked about. Ya know like Fight Club! (Oh damn I wasn't supposed to talk about it.)
Let me see if I have this right. I tried this [audio src="https://files.catbox.moe/g9tiu1.mp3" controls="controls"] it does show up in the "preview" but once I create the post it's blank.
I mean, what I got from your post was that this code should work it's just not talked about. Ya know like Fight Club! (Oh damn I wasn't supposed to talk about it.)
It apparently looks to be a little bit more complicated than that now! Back then the majority of embeds were built on the client side via flashEmbed or some inhouse library that detected if the user's browser was HTML5 compatible and output the HTML5 version rather than the flash version via javascript dropped directly into the post. All of that changed and the only tags that retained that javascript-directly-in-the-post model were the spoiler tag and this "unused" (so never updated) audio tag. Unfortunately this means the tag is currently unusable in this current form unless a feature mimic library such as the one below is added to the forum's header to get those audio tags working again