web/codecs: fix libav load not working

This commit is contained in:
dumbmoron 2024-08-23 18:22:53 +00:00
parent 9e382ee969
commit c966cf36e7
No known key found for this signature in database

View file

@ -7,7 +7,7 @@ const has = <T extends object>(obj: T, key: string) => {
export default class WebCodecsWrapper { export default class WebCodecsWrapper {
#libav: Promise<LibAV>; #libav: Promise<LibAV>;
#ready: Promise<void> | undefined; #ready?: Promise<void>;
constructor(libav: Promise<LibAV>) { constructor(libav: Promise<LibAV>) {
this.#libav = libav; this.#libav = libav;
@ -17,7 +17,7 @@ export default class WebCodecsWrapper {
if (typeof this.#ready === 'undefined') { if (typeof this.#ready === 'undefined') {
this.#ready = LibAVPolyfill.load({ this.#ready = LibAVPolyfill.load({
polyfill: false, polyfill: false,
LibAV: await this.#libav LibAV: { LibAV: () => this.#libav }
}); });
} }