mirror of
https://github.com/wukko/cobalt.git
synced 2024-11-15 12:50:01 +00:00
web/remux: override mp3 extension from mime type
This commit is contained in:
parent
d446dfd87e
commit
7d10ab765e
1 changed files with 8 additions and 1 deletions
|
@ -66,8 +66,15 @@ export default class LibAVWrapper {
|
|||
if (!this.libav) throw new Error("LibAV wasn't initialized");
|
||||
const libav = await this.libav;
|
||||
const inputKind = blob.type.split("/")[0];
|
||||
const inputExtension = mime.getExtension(blob.type);
|
||||
let inputExtension;
|
||||
|
||||
const extensions = mime.getAllExtensions(blob.type);
|
||||
if (extensions?.has('mp3')) {
|
||||
inputExtension = 'mp3';
|
||||
} else if (extensions) {
|
||||
inputExtension = [...extensions][0];
|
||||
}
|
||||
console.log(extensions, blob);
|
||||
if (inputKind !== "video" && inputKind !== "audio") return;
|
||||
if (!inputExtension) return;
|
||||
|
||||
|
|
Loading…
Reference in a new issue