check visibility, add quater css

This commit is contained in:
j 2022-09-26 13:35:41 +01:00
parent f9b30f1fd8
commit c32d2ec57a
2 changed files with 9 additions and 4 deletions

View file

@ -55,7 +55,11 @@
.left {
float: left;
padding-right: 1vw;
width: 30%;
width: 50%;
&.quater {
width: 320px;
height: 240px;
}
}
.clearpara {
clear: left;

View file

@ -173,8 +173,9 @@ function renderAnnotation(config, video, root, clip) {
updatePlayer(video, frame, annotation['in'], annotation['out'], src, config)
}
}))
console.log('add resize')
window.addEventListener('resize', () => {
var visible = isElementInViewport(frame);
var visible = video._frame == frame;
if (config.loaded && visible) {
updatePlayerRect(video, frame, config)
}