mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-01-11 22:40:26 +01:00
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:
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user