Skip to main content

MediaInfo <TFormat>

Wrapper for the MediaInfoLib WASM module.

This class should not be instantiated directly. Use the mediaInfoFactory function to create instances of MediaInfo.

Index

General Use

readonlyoptions

options: Required<Omit<MediaInfoFactoryOptions<TFormat>, locateFile>>

analyzeData

  • Convenience method for analyzing a buffer chunk by chunk.


    Parameters

    • size: SizeArg

      Return total buffer size in bytes.

    • readChunk: ReadChunkFunc

      Read chunk of data and return an Uint8Array.

    Returns Promise<ResultMap[TFormat]>

close

  • close(): void
  • Close the MediaInfoLib WASM instance.


    Returns void

Low-level

inform

  • inform(): string
  • Receive result data from the WASM instance.

    (This is a low-level MediaInfoLib function.)


    Returns string

    Result data (format can be configured in options)

openBufferContinue

  • openBufferContinue(data: Uint8Array<ArrayBufferLike>, size: number): boolean
  • Send more data to the WASM instance.

    (This is a low-level MediaInfoLib function.)


    Parameters

    • data: Uint8Array<ArrayBufferLike>

      Data buffer

    • size: number

      Buffer size

    Returns boolean

    Processing state: 0 (no bits set) = not finished, Bit 0 set = enough data read for providing information

openBufferContinueGotoGet

  • openBufferContinueGotoGet(): number
  • Retrieve seek position from WASM instance. The MediaInfoLib function Open_Buffer_GoTo returns an integer with 64 bit precision. It would be cut at 32 bit due to the JavaScript bindings. Here we transport the low and high parts separately and put them together.

    (This is a low-level MediaInfoLib function.)


    Returns number

    Seek position (where MediaInfoLib wants go in the data buffer)

openBufferFinalize

  • openBufferFinalize(): void
  • Inform MediaInfoLib that no more data is being read.

    (This is a low-level MediaInfoLib function.)


    Returns void

openBufferInit

  • openBufferInit(size: number, offset: number): void
  • Prepare MediaInfoLib to process a data buffer.

    (This is a low-level MediaInfoLib function.)


    Parameters

    • size: number

      Expected buffer size

    • offset: number

      Buffer offset

    Returns void