feat(label): video process

This commit is contained in:
2026-02-27 13:57:42 +08:00
parent 36d5a0e5b0
commit bb70cee307
7 changed files with 348 additions and 614 deletions

View File

@@ -498,6 +498,12 @@ interface ImageState {
setImages: (value: any) => void
}
interface VideoFrameState {
videoFrames: Map<string, string[]>
setVideoFrames: (key: string, value: string[]) => void
removeVideoFrames: (key: string) => void
}
export const useImagesStore = create(
persist<ImageState>(
(storeSet) => ({
@@ -516,3 +522,33 @@ export const useImagesStore = create(
}
)
)
export const useVideoFrameStore = create(
persist<VideoFrameState>(
(storeSet) => ({
videoFrames: new Map(),
setVideoFrames: (key: string, value: string[]) =>
storeSet((state) => {
const nextMap = new Map(state.videoFrames)
nextMap.set(key, value)
return {
...state,
videoFrames: nextMap,
}
}),
removeVideoFrames: (key: string) =>
storeSet((state) => {
const nextMap = new Map(state.videoFrames)
nextMap.delete(key)
return {
...state,
videoFrames: nextMap,
}
}),
}),
{
name: "video-frame-storage",
storage: storage,
}
)
)