diff --git a/app/static/js/ascroll.js b/app/static/js/ascroll.js index 2a584b4..d62bc97 100755 --- a/app/static/js/ascroll.js +++ b/app/static/js/ascroll.js @@ -41,6 +41,14 @@ function setVideoSrc(video, src) { } } +function resize() { + var video = document.querySelector('video') + if (video && video._frame) { + var rect = video._frame.getBoundingClientRect(); + video.style.top = (rect.top + window.scrollY) + 'px' + } +} + function updatePlayer(video, frame, currentTime, out, src) { var rect = frame.getBoundingClientRect(); video.style.opacity = 0 @@ -362,3 +370,6 @@ if (config.annotations) { } else { loadAnnotations(config) } + + +window.addEventListener('resize', resize, false);