diff options
Diffstat (limited to 'script.js')
-rw-r--r-- | script.js | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -12,14 +12,15 @@ const observer = new IntersectionObserver(entries => { // note - if the boundingClientRect.y is negative, then they are scrolling down // note - since using id, only 1 entry const {intersectionRatio, boundingClientRect} = entries[0]; - if (intersectionRatio !== 1 && boundingClientRect.y <= 0) { + console.log(entries[0]) + if (intersectionRatio !== 1 ) { videoTitle.currentTime = 5 - 3 * intersectionRatio; } else { videoTitle.currentTime = 2; } }, { threshold: [...Array(THRESHOLD_FIDELITY).keys()].map(num => num/THRESHOLD_FIDELITY), - rootMargin: '-75px' + rootMargin: '-150px 0px 0px 0px' }); // after two seconds pause the video |