File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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 ( / ^ i m a g e \/ ( p n g | j p e ? g | w e b p | b m p | g i f | x - i c o n | v n d \. m i c r o s o f t \. i c o n | i c o ) $ / i. test ( d . mime ) ) {
259+ if ( / ^ ( i m a g e \/ ( p n g | j p e ? g | w e b p | b m p | g i f | x - i c o n | v n d \. m i c r o s o f t \. i c o n | i c o ) | v i d e o \/ . * | a u d i o \/ . * ) $ / 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" ) ;
You can’t perform that action at this time.
0 commit comments