Ensuring the js to play the header videos is only attempted when the header video...
authorLaury GvR <laury@gaslightmedia.com>
Thu, 17 Aug 2017 16:20:41 +0000 (12:20 -0400)
committerLaury GvR <laury@gaslightmedia.com>
Thu, 17 Aug 2017 16:20:41 +0000 (12:20 -0400)
js/app.js
js/custom/pageSetup.js

index 3c112af..2168a1f 100644 (file)
--- 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();
+    }
 });
index 6c79d42..64e0ee2 100644 (file)
@@ -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();
+    }
 });