For vzaar responsive videos

The tip is optional. The issue has been resolved in WPLMS 2.0.1 update.

Add this in wp-admin->appearance->themes->editor->WPLMS child theme(Any)->functions.php

add_action('wp_footer','vzaar_responsive_videos_wplms',99);
function vzaar_responsive_videos_wplms(){
?><script>
(function ($) {
aspectRatio = function () {
var video = $('.vzaar-video-player');
var w = video.attr('width');
var h = video.attr('height');
// This is the part that does the hard work:
// height divided by width to calculate the ratio as a fraction,
// multiply by 100 and concatenate a % sign.
var ratio = ((h/w) * 100).toFixed(2) + "%";
$('.vzaar-video-player').css('width','100%');
var height = $('.vzaar-video-player').width() * (h/w);
$('.vzaar-video-player').css('height',height+'px');
$('.videoContainer').css('padding-bottom', ratio);
}
})(jQuery);

jQuery(document).ready(function(){
aspectRatio();
});</script>
<?php
}

 

 

Leave a Reply

Your email address will not be published. Required fields are marked *