From f8628798a35256e2df3af859d9f299fe4c42c836 Mon Sep 17 00:00:00 2001 From: Matt Dawkins Date: Thu, 24 Sep 2026 20:49:52 -0400 Subject: [PATCH] Keep the pixel data when capturing a frame from an image element ImageData's data, width and height are prototype getters, so spreading it produced an object without pixels; Firefox then failed stereo transfers. --- client/dive-common/use/stereo/frameSource.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/client/dive-common/use/stereo/frameSource.ts b/client/dive-common/use/stereo/frameSource.ts index d3b871dc8..ff2c4334b 100644 --- a/client/dive-common/use/stereo/frameSource.ts +++ b/client/dive-common/use/stereo/frameSource.ts @@ -27,7 +27,9 @@ export function imageElementToRgba( const ctx = canvas.getContext('2d'); if (!ctx) throw new Error('Could not get 2d canvas context'); ctx.drawImage(img as CanvasImageSource, 0, 0, width, height); - return { ...ctx.getImageData(0, 0, width, height), width, height }; + // ImageData's fields are prototype getters, which a spread would drop. + const { data } = ctx.getImageData(0, 0, width, height); + return { data, width, height }; } /**