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:
2026-08-01 17:03:47 +08:00
parent 3a5f160453
commit a7697fd4a1
7 changed files with 132 additions and 60 deletions
+2 -2
View File
@@ -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 {