- added Konvas lib

- added feed from proof of concept
This commit is contained in:
2025-11-21 10:12:42 +00:00
parent 8284b1dd11
commit a21b7bb87e
9 changed files with 200 additions and 7 deletions

View File

@@ -0,0 +1,25 @@
import { useEffect, useRef } from "react";
import { useGetVideoFeed } from "./useGetVideoFeed";
export const useCreateVideoSnapshot = () => {
const latestBitmapRef = useRef<ImageBitmap | null>(null);
const { videoQuery } = useGetVideoFeed();
const snapShot = videoQuery?.data;
useEffect(() => {
async function createBitmap() {
if (!snapShot) return;
try {
const bitmap = await createImageBitmap(snapShot);
latestBitmapRef.current = bitmap;
} catch (error) {
console.log(error);
}
}
createBitmap();
}, [snapShot]);
return { latestBitmapRef };
};