From: Laury GvR Date: Thu, 17 Aug 2017 16:20:41 +0000 (-0400) Subject: Ensuring the js to play the header videos is only attempted when the header video... X-Git-Tag: v1.0.8^2 X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/?a=commitdiff_plain;h=55c1fa563655855ecc8f59f9e94ac9fa65959d85;p=WP-Themes%2Ftruenorthgolf.git Ensuring the js to play the header videos is only attempted when the header video exists --- 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(); + } });