diff --git a/packages/extension/src/background/index.ts b/packages/extension/src/background/index.ts index 90bc105..e1e9a64 100644 --- a/packages/extension/src/background/index.ts +++ b/packages/extension/src/background/index.ts @@ -245,8 +245,7 @@ async function uploadTrackGif(buffer: RecorderBuffer, startedAt: number): Promise { if (buffer.video.length) { const viewport = (buffer.environment?.viewport as { w?: number; h?: number } | undefined) ?? null; - // the WebM crop is generous (768 CSS px); the GIF fallback keeps 512 so - // its file size stays sane + // the WebM crop is generous (768 CSS px); the GIF fallback matches it const crop = viewport?.w && viewport?.h ? { viewport: { w: viewport.w, h: viewport.h }, startedAt, track: buildMouseTrack(buffer)?.points ?? [], size: 768 } @@ -260,8 +259,11 @@ } try { // video encoding failed but the screencast frames are here — cursor GIF - // (always a 512px square, regardless of the video crop size) - const gifCrop = crop ? { ...crop, size: 512 } : { size: 512, viewport: { w: 1280, h: 720 }, startedAt, track: [] }; + // at the same 768px square as the video; fewer frames (150 vs 240) keep + // the heavier 768px GIF under the server's 25MB upload limit + const gifCrop = crop + ? { ...crop, size: 768, maxFrames: 150 } + : { size: 768, maxFrames: 150, viewport: { w: 1280, h: 720 }, startedAt, track: [] }; const blob = await buildCursorGif(buffer.video, gifCrop); if (blob) return await uploadRecordingMedia(blob, "recording.gif"); debugLog("cursor gif failed: no frames encoded");