fix: pack all frames into single blob for IndexedDB storage
Previously each frame was stored as a separate Blob in the Recording object, causing IndexedDB to hang when writing 100+ blobs in one transaction. Now all frames are packed into a single binary blob: [4B frameCount][per frame: 4B ts, 4B len, JPEG data] DB version bumped to 2 (old store deleted on upgrade). PlaybackPanel unpacks frames on demand with a per-recording cache.
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { ref, type Ref } from 'vue'
|
||||
import { saveRecording, type Recording } from './useStorage'
|
||||
import { saveRecording, packFrames, type Recording } from './useStorage'
|
||||
|
||||
export type RecorderState = 'idle' | 'recording' | 'saving'
|
||||
|
||||
@@ -161,7 +161,7 @@ export function useRecorder() {
|
||||
createdAt: new Date(),
|
||||
duration: elapsedMs.value,
|
||||
frameCount: savedFrames.length,
|
||||
frames: savedFrames,
|
||||
data: packFrames(savedFrames),
|
||||
}
|
||||
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user