spee.ch/views/partials/image.handlebars

15 lines
574 B
Handlebars
Raw Normal View History

<video id="video-player" controls poster="{{claimInfo.thumbnail}}">
<source id="asset">
<!--fallback-->
Your browser does not support the <code>video</code> element.
</video>
<!--dynamically resize video player-->
<script type="text/javascript">
document.addEventListener('DOMContentLoaded', resizeVideoPlayer)
window.addEventListener("resize", resizeVideoPlayer);
function resizeVideoPlayer() {
const div = document.getElementById('video-player');
const width = div.offsetWidth;
div.height = (width * 9 / 16);
}
</script>