From da7c6ce527acfc2d76a837175b6d06adf82f2926 Mon Sep 17 00:00:00 2001 From: Oliver Davies Date: Wed, 12 Jun 2019 21:37:32 +0100 Subject: [PATCH] Clean up video partial --- source/_partials/talk/video.html.twig | 23 ++++------------------- 1 file changed, 4 insertions(+), 19 deletions(-) diff --git a/source/_partials/talk/video.html.twig b/source/_partials/talk/video.html.twig index 06e5ef3f..22cf304f 100644 --- a/source/_partials/talk/video.html.twig +++ b/source/_partials/talk/video.html.twig @@ -1,31 +1,16 @@ -{% macro videoSrc(talk) %} - {# TODO: Cleanup once videos have been added to talks properly. #} - {% set videoType = talk.video.type %} - {% set videoId = talk.video.id %} - - {% if talk.youtube %} - {% set videoType = 'youtube' %} - {% set videoId = talk.youtube.id %} - {% endif %} - - {% if talk.vimeo %} - {% set videoType = 'vimeo' %} - {% set videoId = talk.vimeo.id %} - {% endif %} - +{% macro videoSrc(video) %} {% set srcUrls = { youtube: '//www.youtube.com/embed', videopress: 'https://videopress.com/embed', vimeo: 'https://player.vimeo.com/video', } %} - {{ srcUrls[videoType] ~ '/' ~ videoId }} + {{ srcUrls[video.type] ~ '/' ~ video.id }} {% endmacro %} {% from _self import videoSrc %} -{# TODO: Cleanup once videos have been added to talks properly. #} -{% if page.youtube.id or page.vimeo.id or page.video %} +{% if page.video.id %}

Video

@@ -33,7 +18,7 @@