Small tweaks to video playback

This commit is contained in:
Mike Wickett 2018-06-25 13:41:31 -04:00 committed by Jack Pearkes
parent bdd066425c
commit 45df69cf48

View File

@ -28,7 +28,9 @@ function initialiateVideoChange(index) {
loadingBar.style.transitionDuration = '0s' loadingBar.style.transitionDuration = '0s'
// reset the current video // reset the current video
if (!isNaN($$videos[currentIndex].duration)) {
$$videos[currentIndex].currentTime = 0 $$videos[currentIndex].currentTime = 0
}
$$videoControls[currentIndex].classList.remove('playing') $$videoControls[currentIndex].classList.remove('playing')
// stop deactivation // stop deactivation
@ -59,7 +61,8 @@ function playVideo(index, wrapper) {
$$videoControls[index].querySelector( $$videoControls[index].querySelector(
'.progress-bar span' '.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 // set the currentIndex to be that of the current video's index
currentIndex = index currentIndex = index