{% 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 page.video.id %}
    <div class="mt-4">
        <h2 class="mb-2">Video</h2>

        <div class="video-full">
            <iframe
                width="678"
                height="408"
                src="{{ videoSrc(page.video) }}"
                frameborder="0"
                allowfullscreen
            >
            </iframe>
        </div>
    </div>
{% endif %}