Skip to content

Commit e7b67c6

Browse files
committed
fix: video and audio handling
1 parent e266e6d commit e7b67c6

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

src/index.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -254,9 +254,9 @@ class CoCreateFileSystem {
254254
return d.data;
255255
}
256256
}
257-
// Raster images and Icons -> Buffer
257+
// Raster images, Icons, Video, and Audio -> Buffer
258258
// Added x-icon, vnd.microsoft.icon, and ico to process icon files properly
259-
if (/^image\/(png|jpe?g|webp|bmp|gif|x-icon|vnd\.microsoft\.icon|ico)$/i.test(d.mime)) {
259+
if (/^(image\/(png|jpe?g|webp|bmp|gif|x-icon|vnd\.microsoft\.icon|ico)|video\/.*|audio\/.*)$/i.test(d.mime)) {
260260
if (d.isBase64) return Buffer.from(d.data, "base64");
261261
}
262262
// If it's a text data URI (e.g., xml) and not base64, return decoded text
@@ -275,6 +275,8 @@ class CoCreateFileSystem {
275275
if (
276276
contentType.startsWith("image/") ||
277277
contentType.startsWith("font/") ||
278+
contentType.startsWith("video/") ||
279+
contentType.startsWith("audio/") ||
278280
contentType === "application/octet-stream"
279281
) {
280282
return Buffer.from(src, "base64");

0 commit comments

Comments
 (0)