From 55c1fa563655855ecc8f59f9e94ac9fa65959d85 Mon Sep 17 00:00:00 2001 From: Laury GvR Date: Thu, 17 Aug 2017 12:20:41 -0400 Subject: [PATCH] Ensuring the js to play the header videos is only attempted when the header video exists --- js/app.js | 8 ++++++-- js/custom/pageSetup.js | 8 ++++++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/js/app.js b/js/app.js index 3c112af..2168a1f 100644 --- a/js/app.js +++ b/js/app.js @@ -62,6 +62,10 @@ $(document).ready(function () { }); var headerVideo = document.getElementById('headerVideo'); var headerVideoMobile = document.getElementById('headerVideoMobile'); - headerVideo.play(); - headerVideoMobile.play(); + if (headerVideo) { + headerVideo.play(); + } + if (headerVideoMobile) { + headerVideoMobile.play(); + } }); diff --git a/js/custom/pageSetup.js b/js/custom/pageSetup.js index 6c79d42..64e0ee2 100644 --- a/js/custom/pageSetup.js +++ b/js/custom/pageSetup.js @@ -53,6 +53,10 @@ $(document).ready(function () { }); var headerVideo = document.getElementById('headerVideo'); var headerVideoMobile = document.getElementById('headerVideoMobile'); - headerVideo.play(); - headerVideoMobile.play(); + if (headerVideo) { + headerVideo.play(); + } + if (headerVideoMobile) { + headerVideoMobile.play(); + } }); -- 2.17.1