From c69bdb0c0677fa9b0a77fe758c7a665d2c23fa2f Mon Sep 17 00:00:00 2001 From: Alexander Zinchuk Date: Thu, 27 Apr 2023 18:53:20 +0400 Subject: [PATCH] Media Viewer: Fix previews in Firefox (#3100) --- src/lib/video-preview/polyfill/index.ts | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/src/lib/video-preview/polyfill/index.ts b/src/lib/video-preview/polyfill/index.ts index 3e2453a2e..260ca5e39 100644 --- a/src/lib/video-preview/polyfill/index.ts +++ b/src/lib/video-preview/polyfill/index.ts @@ -54,15 +54,9 @@ export async function load( await libav.load(); if (options.polyfill) { - for (const exp of [ - 'EncodedVideoChunk', - 'VideoFrame', - 'VideoDecoder', - ]) { - if (!(global as any)[exp]) { - (global as any)[exp] = (this as any)[exp]; - } - } + globalThis.VideoDecoder = vdec.VideoDecoder; + globalThis.VideoFrame = vf.VideoFrame; + globalThis.EncodedVideoChunk = evc.EncodedVideoChunk; } await rendering.load(libavOptions, !!options.polyfill);