40 lines
770 B
PHTML
40 lines
770 B
PHTML
<?php
|
|
$this->headScript()->appendFile($this->assetUrl('js/height_calculator.js',
|
|
'Vimeo'));
|
|
?>
|
|
|
|
<div class="vimeo-embed-wrapper"
|
|
style="position:relative;">
|
|
|
|
<?php if ($renderSourceLink) { ?>
|
|
<div class="source-link">
|
|
<a href="<?= $item_url ?>">Source</a>
|
|
</div>
|
|
<?php } ?>
|
|
|
|
<?= $vimeo_iframe ?>
|
|
|
|
<?php if ($title) { ?>
|
|
<div class="item_title">
|
|
<?= $title ?>
|
|
</div>
|
|
<?php } ?>
|
|
|
|
</div>
|
|
|
|
<script>
|
|
function adjust_height() {
|
|
$(".vimeo-embed-wrapper").each(function() {
|
|
var iframe = $(this).find('iframe')
|
|
var ratio = $(iframe).attr('ratio')
|
|
$(iframe).prop("height", get_height(iframe, ratio))
|
|
});
|
|
}
|
|
jQuery(document).ready(function() {
|
|
adjust_height();
|
|
});
|
|
$( window ).resize(function() {
|
|
adjust_height();
|
|
});
|
|
</script>
|