Vimeo-omeka-module/view/common/block-layout/vimeo.phtml

40 lines
831 B
PHTML

<?php
$this->headScript()->appendFile($this->assetUrl('js/height_calculator.js',
'Vimeo'));
?>
<div id="vimeo_<?= $video_id ?>" 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')
$(iframe).prop("width", "<?= $width ?>%")
var height = get_height(iframe, <?= $ratio ?>)
$(iframe).prop("height", height)
});
}
jQuery(document).ready(function() {
adjust_height();
});
$( window ).resize(function() {
adjust_height();
});
</script>