Post by Chris on Feb 29, 2016 8:24:36 GMT -8
Stumbled across a thread I had totally forgotten about...
Original Thread: Supported Video Sites
Basically the direct link Photobucket gives you is the wrong link, you have to extract the correct link (the one with "album" in the URL) from the embed code instead and URI decode it.
We tried adding Photobucket support for videos as this was a requested feature, but we discovered that we are unable to implement this with only the URL to a Photobucket video at this time.
The code basically adds a Photobucket entry to the list of supported videos then asks for the embed code (not the direct link -- see images below) and converts that to a link that can then become a video on a forum.
Drop this in your global header
code:(revision 2)
click on the photobucket.com link that has been added by this code to the list of supported videos in the add video dialog in order to get a second dialog that then allows you to paste the embed (aka html) code [see image above]
Original Thread: Supported Video Sites
Basically the direct link Photobucket gives you is the wrong link, you have to extract the correct link (the one with "album" in the URL) from the embed code instead and URI decode it.
We tried adding Photobucket support for videos as this was a requested feature, but we discovered that we are unable to implement this with only the URL to a Photobucket video at this time.
The code basically adds a Photobucket entry to the list of supported videos then asks for the embed code (not the direct link -- see images below) and converts that to a link that can then become a video on a forum.
Drop this in your global header
code:(revision 2)
<script type="text/javascript">
(function(){
var wc = $.ui.wysiwyg.prototype._create,w,$f
$.ui.wysiwyg.prototype._create = function(){
w = this;
wc.apply(this);
$('#video-list-info').livequery(function(){
if($('li.video-photobucket',this).length) return;
var $f = $(this).parent().find('input[name="url"]')
$('a[href*="ustream.tv"]',this).parent().before('<li class="video-photobucket"></li>')
.prev().append('<a href="http://photobucket.com/" target="_blank">Photobucket.com</a>')
.children('a').on('click', function(e){
e.preventDefault();
var dialog = w.dialog;
w.dialog = $('<div></div>')
.insertBefore(dialog)
.hide()
.dialog({
autoOpen: false,
height: 'auto',
width: 'auto',
dialogClass: 'photobucket-dialog',
close: function() {
$.clearInputError();
w.dialog.remove();
w.dialog = dialog;
$('input',dialog).first().focus().select()
}
})
w._prompt({
title: 'Photobucket Embed Code',
extraInfo: '<div style="max-width:400px;font-size:0.7em;">paste your photobucket embed code and we\'ll attempt to convert it to an URL for you. If you already have an url that has the "/album/" part in it and ends in ".mp4" you can close this dialog and enter it directly</div>',
fields: [{
input: true,
type: "text",
title: "Embed Code",
name: 'embed',
required: true
}],
ieWidth: 400, //guessed :P
callback: function(values){
var url;
if((url =values.embed.match(/(https?)([a-z0-9_%:\.\/]+?)(\.mp4)([^a-z0-9_%\.\/]|$)/i)) && url[3] && /\/albums\//.test((url[2]=decodeURIComponent(url[2])))){
$f.val(url[1] + url[2] + ".mp4");
}else{ proboards.alert('No MP4 Photobucket video URL found!');}
}
})
setTimeout(function(){
$('.photobucket-dialog input[name="embed"]').focus().select();
},0)
})
})
}
})()
</script>
click on the photobucket.com link that has been added by this code to the list of supported videos in the add video dialog in order to get a second dialog that then allows you to paste the embed (aka html) code [see image above]