Fix video-js resize

This commit is contained in:
Romain Neutron
2012-07-16 17:29:54 +02:00
parent 8c51c16bb2
commit a911e0745a
2 changed files with 12 additions and 3 deletions

View File

@@ -12,6 +12,10 @@
preload="auto" xposter="my_video_poster.png" width="{{ displayWidth|round }}" height="{{ displayHeight | round }}" preload="auto" xposter="my_video_poster.png" width="{{ displayWidth|round }}" height="{{ displayHeight | round }}"
data-setup="{}"> data-setup="{}">
{% for name, subdef in arraySubdefs %} {% for name, subdef in arraySubdefs %}
{% if loop.first %}
<input type="hidden" name="width" value="{{subdef.get_width()}}"/>
<input type="hidden" name="height" value="{{subdef.get_height()}}"/>
{% endif %}
{% if session.is_authenticated() == true %} {% if session.is_authenticated() == true %}
{% set url = subdef.get_url() %} {% set url = subdef.get_url() %}
{% else %} {% else %}
@@ -26,7 +30,11 @@
$(document).ready(function(){ $(document).ready(function(){
try { try {
_V_("video_preview_tooltip", {}, function(){ _V_("video_preview_tooltip", {}, function(){
var player = this;
$('#video_preview_tooltip').parent().bind('resize-video-js', function(){
player.width($(this).width());
player.height($(this).height());
});
}); });
} catch(err) { } catch(err) {
console.error('An error has been catched during the execution of VideoJS', err); console.error('An error has been catched during the execution of VideoJS', err);

View File

@@ -498,6 +498,7 @@ function setPreview(){
top: t, top: t,
left: l left: l
}).attr('width',w).attr('height',h); }).attr('width',w).attr('height',h);
$('#PREVIEWIMGCONT .record').trigger('resize-video-js');
} }
function classicMode(){ function classicMode(){