- Implement CameraFeed context and provider with reducer for state management
- able to switch footage on tab clicks
This commit is contained in:
@@ -1,9 +1,12 @@
|
||||
import { useEffect, useRef } from "react";
|
||||
import { useGetVideoFeed } from "./useGetVideoFeed";
|
||||
import { useCameraFeedContext } from "../../../app/context/CameraFeedContext";
|
||||
|
||||
export const useCreateVideoSnapshot = () => {
|
||||
const { state } = useCameraFeedContext();
|
||||
const cameraFeedID = state?.cameraFeedID;
|
||||
const latestBitmapRef = useRef<ImageBitmap | null>(null);
|
||||
const { videoQuery } = useGetVideoFeed();
|
||||
const { videoQuery } = useGetVideoFeed(cameraFeedID);
|
||||
|
||||
const snapShot = videoQuery?.data;
|
||||
const isloading = videoQuery.isPending;
|
||||
|
||||
Reference in New Issue
Block a user