diff --git a/web/src/lib/libav.ts b/web/src/lib/libav.ts index 69747464..7e50d911 100644 --- a/web/src/lib/libav.ts +++ b/web/src/lib/libav.ts @@ -31,9 +31,13 @@ export default class LibAVWrapper { } } - async probe(blob: Blob) { + async #get() { if (!this.libav) throw new Error("LibAV wasn't initialized"); - const libav = await this.libav; + return await this.libav; + } + + async probe(blob: Blob) { + const libav = await this.#get(); await libav.mkreadaheadfile('input', blob); @@ -72,8 +76,8 @@ export default class LibAVWrapper { } async remux({ blob, output, args }: RenderParams) { - if (!this.libav) throw new Error("LibAV wasn't initialized"); - const libav = await this.libav; + const libav = await this.#get(); + const inputKind = blob.type.split("/")[0]; const inputExtension = LibAVWrapper.getExtensionFromType(blob); @@ -230,4 +234,4 @@ export default class LibAVWrapper { this.onProgress(progress); } -} \ No newline at end of file +}