mirror of
https://github.com/wukko/cobalt.git
synced 2025-01-27 05:06:18 +01:00
web/libav: accept canonical extension if blob is a file
This commit is contained in:
parent
c5e7b29c6c
commit
75cda47633
2 changed files with 8 additions and 3 deletions
|
@ -56,9 +56,14 @@ export default class LibAVWrapper {
|
|||
}
|
||||
}
|
||||
|
||||
static getExtensionFromType(blob: Blob) {
|
||||
static getExtensionFromType(blob: Blob | File) {
|
||||
const canonicalExtension = blob instanceof File && blob.name.split('.').pop()?.toLowerCase();
|
||||
const extensions = mime.getAllExtensions(blob.type);
|
||||
const overrides = ['mp3', 'mov'];
|
||||
|
||||
if (canonicalExtension && extensions?.has(canonicalExtension))
|
||||
return canonicalExtension;
|
||||
|
||||
const overrides = ['mp3', 'mov', 'opus'];
|
||||
|
||||
if (!extensions)
|
||||
return;
|
||||
|
|
|
@ -7,7 +7,7 @@ export type FileInfo = {
|
|||
}
|
||||
|
||||
export type RenderParams = {
|
||||
blob: Blob,
|
||||
blob: Blob | File,
|
||||
output?: FileInfo,
|
||||
args: string[],
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue