I´m trying to display an HTML5 with a colorbox lightbox. The way I´m doing it is something like this:
var html ='<video>'+sources+'</video>';
$.colorbox({html:html});
where sources is a variable that contains the html of the source tags. My problem is that even though the colorbox lightbox appears, the video doesn't show. I've checked with Firebug and the whole html is there. Any idea why it might not show it?
Thanks.
I´m trying to display an HTML5 with a colorbox lightbox. The way I´m doing it is something like this:
var html ='<video>'+sources+'</video>';
$.colorbox({html:html});
where sources is a variable that contains the html of the source tags. My problem is that even though the colorbox lightbox appears, the video doesn't show. I've checked with Firebug and the whole html is there. Any idea why it might not show it?
Thanks.
Share Improve this question edited Jan 16, 2012 at 8:49 lgomezma asked Jan 13, 2012 at 16:39 lgomezmalgomezma 1,6472 gold badges16 silver badges30 bronze badges1 Answer
Reset to default 6You can display it using the inline html mode
$( document ).ready( function() {
$( '#openColorbox' ).colorbox( {
inline : true,
width : '80%',
height : 'auto',
href : '#inlinevideocontent'
} );
} );
and here is your inline div
<div style='display:none'>
<div id='inlinevideocontent' >
<video controls="controls" src="video.mp4" />
</div>
</div>