mirror of
https://github.com/wukko/cobalt.git
synced 2024-11-15 12:50:01 +00:00
web/libav: try to guess type from filename if browser fails
This commit is contained in:
parent
911f283b78
commit
a4d57f175e
1 changed files with 8 additions and 1 deletions
|
@ -6,9 +6,10 @@
|
||||||
import DropReceiver from "$components/misc/DropReceiver.svelte";
|
import DropReceiver from "$components/misc/DropReceiver.svelte";
|
||||||
import FileReceiver from "$components/misc/FileReceiver.svelte";
|
import FileReceiver from "$components/misc/FileReceiver.svelte";
|
||||||
import { createDialog } from "$lib/dialogs";
|
import { createDialog } from "$lib/dialogs";
|
||||||
|
import mime from "mime";
|
||||||
|
|
||||||
let draggedOver = false;
|
let draggedOver = false;
|
||||||
let file: File | undefined;
|
let file: File | Blob | undefined;
|
||||||
|
|
||||||
let totalDuration: number | undefined;
|
let totalDuration: number | undefined;
|
||||||
let processedDuration: number | undefined;
|
let processedDuration: number | undefined;
|
||||||
|
@ -66,6 +67,12 @@
|
||||||
|
|
||||||
totalDuration = Number(file_info.format.duration);
|
totalDuration = Number(file_info.format.duration);
|
||||||
|
|
||||||
|
if (file instanceof File && !file.type) {
|
||||||
|
file = new Blob([ file ], {
|
||||||
|
type: mime.getType(file.name) ?? undefined
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
const render = await ff.render({
|
const render = await ff.render({
|
||||||
blob: file,
|
blob: file,
|
||||||
args: ['-c', 'copy', '-map', '0']
|
args: ['-c', 'copy', '-map', '0']
|
||||||
|
|
Loading…
Reference in a new issue