Skip to content

Commit

Permalink
web/remux: override mp3 extension from mime type
Browse files Browse the repository at this point in the history
  • Loading branch information
dumbmoron committed Aug 17, 2024
1 parent d446dfd commit 7d10ab7
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion web/src/lib/libav.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 7d10ab7

Please sign in to comment.