diff --git a/website/source/assets/javascripts/consul-connect/home-hero.js b/website/source/assets/javascripts/consul-connect/home-hero.js index 92ead8aac..94d9ed9fc 100644 --- a/website/source/assets/javascripts/consul-connect/home-hero.js +++ b/website/source/assets/javascripts/consul-connect/home-hero.js @@ -27,8 +27,10 @@ function initialiateVideoChange(index) { ) loadingBar.style.transitionDuration = '0s' - // reset the current video - $$videos[currentIndex].currentTime = 0 + // reset the current video + if (!isNaN($$videos[currentIndex].duration)) { + $$videos[currentIndex].currentTime = 0 + } $$videoControls[currentIndex].classList.remove('playing') // stop deactivation @@ -59,7 +61,8 @@ function playVideo(index, wrapper) { $$videoControls[index].querySelector( '.progress-bar span' - ).style.transitionDuration = `${Math.ceil($$videos[index].duration / playbackRate)}s` + ).style.transitionDuration = + Math.ceil($$videos[index].duration / playbackRate).toString() + 's' // set the currentIndex to be that of the current video's index currentIndex = index @@ -88,4 +91,4 @@ for (var i = 0; i < $$videoControls.length; i++) { // go to first video to start this thing if ($$videos.length > 0) { initialiateVideoChange(0) -} \ No newline at end of file +}