oliverdavies.uk/website/source/_includes/talk/video.html.twig
Oliver Davies 0a6280ff2d chore: update YouTube embed code
* Only show related videos from the same channel.
* Disable video annotations.
2022-07-20 11:16:06 +01:00

29 lines
696 B
Twig

{% macro videoSrc(video) %}
{% set srcUrls = {
youtube: '//www.youtube.com/embed',
videopress: 'https://videopress.com/embed',
vimeo: 'https://player.vimeo.com/video',
} %}
{{ srcUrls[video.type] ~ '/' ~ video.id }}
{% endmacro %}
{% from _self import videoSrc %}
{% if video.id %}
<div class="mt-4">
<h2 class="mb-2">Video</h2>
<div class="video-full">
<iframe
width="678"
height="408"
src="{{ videoSrc(video) }}?rel=0&iv_load_policy=3"
frameborder="0"
allowfullscreen
>
</iframe>
</div>
</div>
{% endif %}