Skip to main content

Function: defaultDecoderPool()

defaultDecoderPool(): DecoderPool

Defined in: pool/pool.ts:133

Create a default DecoderPool backed by the built-in worker.

A cached decoder pool instance is returned on subsequent calls.

You may want to create it lazily (rather than as a module-level singleton) to keep the new URL(…, import.meta.url) out of the module's static initialisation, so bundlers that build IIFE/UMD outputs don't try to inline the worker at build time.

Returns

DecoderPool

Example

Create a default decoder pool:

const pool = defaultDecoderPool();