javascript - Custom video-js width and height on Dynamically Loaded Content -
i'm dynamically loading video-js inside foundation reveal, , have trigger width , height each time loads. odd thing is, once i've loaded 1 video on page, won't change again no matter what, sticks 1 size.
this code
$(document).on('opened.fndtn', '[data-reveal]', function () { if($('.sd-video').length) { console.log('sd detected'); videojs($('.sd-video')[0], {"width": 640,"height": 480}, function() {}); } if($('.hd-video').length) { console.log('hd detected'); videojs($('.hd-video')[0], {"width": 1287,"height": 720}, function() {}); } }); $(document).on('closed.fndtn', '[data-reveal]', function () { $('#'+$(this).attr('id')).html(''); });
and no matter try, once it's loaded hd, sd not resize, , vice-versa. ideas?
Comments
Post a Comment