UNPKG

@loaders.gl/video

Version:

Framework-independent loaders and writers for video (MP4, WEBM, ...)

28 lines (22 loc) 846 B
// loaders.gl // SPDX-License-Identifier: MIT // Copyright (c) vis.gl contributors // @ts-nocheck import {loadLibrary, type LoadLibraryOptions} from '@loaders.gl/worker-utils'; import {registerJSModules, getJSModule} from '@loaders.gl/loader-utils'; let loadGifshotPromise; export async function loadGifshotModule(options: LoadLibraryOptions = {}) { registerJSModules(options.modules); const gifshot = getJSModule('gifshot'); if (gifshot) { return gifshot; } loadGifshotPromise = loadGifshotPromise || loadGifshot(options); return await loadGifshotPromise; } async function loadGifshot(options: LoadLibraryOptions) { const gifshot = await loadLibrary('gifshot.js', 'gifshot', options); // Depends on how import happened... // @ts-ignore TS2339: Property does not exist on type return gifshot || globalThis.gifshot; }