Skip to content

Instantly share code, notes, and snippets.

@Sitebase
Created December 9, 2014 09:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Sitebase/e68497ef7c4bad436385 to your computer and use it in GitHub Desktop.
Save Sitebase/e68497ef7c4bad436385 to your computer and use it in GitHub Desktop.
Snippet for implementing video attach to a form with BuboBox
<div class="bbbx-widget" data-widget="11"></div>
<script type="text/javascript">
var bbbx_widget_id = 11;
var bbbx_visual = false;
var bbbx_share_enabled = false;
function bbbx_config() {
this.subscribe('published', function(e) {
BBBX.$('.bubobox_result').html('<a href="javascript:mybb.openPlayer(\'' + e.entryId + '\')">Video bekijken</a> | <a href="javascript:mybb.openRecorder()">Video opnieuw opnemen</a>');
BBBX.$('#video_id').val(e.entryId);
});
this.subscribe('recorder.show', function() {
mybb.settings.meta = {'name': BBBX.$('#naam').val() + ' ' + BBBX.$('#voornaam').val()};
});
}
(function() {
var bbbx = document.createElement('script'); bbbx.type = 'text/javascript'; bbbx.async = true;
bbbx.src = '//my.bubobox.com/widget.js?id=' + bbbx_widget_id;
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(bbbx);
})();
</script>
<input type="hidden" id="video_id" name="video_id" /><span class="bubobox_result"><a href="javascript:mybb.openRecorder()">Video opnemen</a></span>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment