update virtual list on browser resize

This commit is contained in:
Roland Osborne 2022-05-18 15:25:29 -07:00
parent b39f24d9a7
commit 55b96bcfcf
2 changed files with 4 additions and 0 deletions

View File

@ -18,6 +18,9 @@ export function VideoFile({ url, onPosition }) {
const onSeek = (offset) => {
if (player.current) {
let len = player.current.getDuration();
if (len > 128) {
offset *= Math.floor(len / 128);
}
seek.current += offset;
if (seek.current < 0 || seek.current >= len) {
seek.current = 0;

View File

@ -316,6 +316,7 @@ export function VirtualList({ id, items, itemRenderer }) {
if (height) {
growCanvasHeight(height * 3);
viewHeight.current = height;
updateCanvas();
}
return (
<VirtualListWrapper onScroll={onScrollView} onWheel={onScrollWheel}>