web/libav: add getter for libav instance
This commit is contained in:
parent
a78f272848
commit
226162f91f
1 changed files with 9 additions and 5 deletions
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue