Fix TypeScript lint errors in AudioViewer and VideoViewer

- Change from data.buffer to new Uint8Array(data) to fix ArrayBufferLike type compatibility with Blob constructor
- Fixes TS2322 errors about SharedArrayBuffer not being assignable to BlobPart
This commit is contained in:
Gregory Schier
2025-12-29 11:00:46 -08:00
parent 25d51a017e
commit 58eff84f43
2 changed files with 2 additions and 2 deletions

View File

@@ -13,7 +13,7 @@ export function AudioViewer({ bodyPath, data }: Props) {
if (bodyPath) {
setSrc(convertFileSrc(bodyPath));
} else if (data) {
const blob = new Blob([data], { type: 'audio/mpeg' });
const blob = new Blob([new Uint8Array(data)], { type: 'audio/mpeg' });
const url = URL.createObjectURL(blob);
setSrc(url);
return () => URL.revokeObjectURL(url);

View File

@@ -13,7 +13,7 @@ export function VideoViewer({ bodyPath, data }: Props) {
if (bodyPath) {
setSrc(convertFileSrc(bodyPath));
} else if (data) {
const blob = new Blob([data], { type: 'video/mp4' });
const blob = new Blob([new Uint8Array(data)], { type: 'video/mp4' });
const url = URL.createObjectURL(blob);
setSrc(url);
return () => URL.revokeObjectURL(url);