set video position on resize
This commit is contained in:
parent
b3b9224071
commit
bffa0b69b1
1 changed files with 11 additions and 0 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue