@ceeblue/web-utils
    Preparing search index...

    Class IsoViewBeta

    ISO BMFF data view. Similar to DataView, but with additional methods for reading ISO BMFF data. It implements the iterator protocol, so it can be used in a for...of loop.

    Index

    Constructors

    • Beta

      Creates a new IsoView instance. Similar to DataView, but with additional methods for reading ISO BMFF data. It implements the iterator protocol, so it can be used in a for...of loop.

      Parameters

      • raw: ArrayBuffer | Uint8Array<ArrayBuffer> | DataView<ArrayBuffer>

        The raw data to view.

      • Optionalconfig: IsoViewConfig

        The configuration for the IsoView.

      Returns IsoView

    Properties

    readArray: <T extends keyof IsoFieldTypeMap>(
        type: T,
        size: number,
        length: number,
    ) => IsoFieldTypeMap[T][]

    Reads an array of values from the data view.

    Type Declaration

      • <T extends keyof IsoFieldTypeMap>(
            type: T,
            size: number,
            length: number,
        ): IsoFieldTypeMap[T][]
      • Type Parameters

        Parameters

        • type: T

          The type of the values.

        • size: number

          The size of the values in bytes.

        • length: number

          The number of values to read.

        Returns IsoFieldTypeMap[T][]

        The array of values.

    readBox: () => RawBox

    Reads a raw box from the data view.

    Type Declaration

    readBoxes: <T = IsoBmffBox>(length: number) => T[]

    Reads a number of boxes from the data view.

    Type Declaration

      • <T = IsoBmffBox>(length: number): T[]
      • Type Parameters

        Parameters

        • length: number

          The number of boxes to read.

        Returns T[]

        The boxes.

    readData: (size: number) => Uint8Array

    Reads a byte array from the data view.

    Type Declaration

      • (size: number): Uint8Array
      • Parameters

        • size: number

          The size of the data in bytes.

        Returns Uint8Array

        The data.

    readEntries: <T>(length: number, map: () => T) => T[]

    Reads a number of entries from the data view.

    Type Declaration

      • <T>(length: number, map: () => T): T[]
      • Type Parameters

        • T

        Parameters

        • length: number

          The number of entries to read.

        • map: () => T

          The function to map the entries.

        Returns T[]

        The entries.

    readFullBox: () => Fields<FullBox>

    Reads a full box from the data view.

    Type Declaration

    readInt: (size: number) => number

    Reads a signed integer from the data view.

    Type Declaration

      • (size: number): number
      • Parameters

        • size: number

          The size of the integer in bytes.

        Returns number

        The signed integer.

    readString: (size: number) => string

    Reads a string from the data view.

    Type Declaration

      • (size: number): string
      • Parameters

        • size: number

          The size of the string in bytes.

        Returns string

        The string.

    readTemplate: (size: number) => number

    Reads a template from the data view.

    Type Declaration

      • (size: number): number
      • Parameters

        • size: number

          The size of the template in bytes.

        Returns number

        The template.

    readUint: (size: number) => number

    Reads a unsigned integer from the data view.

    Type Declaration

      • (size: number): number
      • Parameters

        • size: number

          The size of the integer in bytes.

        Returns number

        The unsigned integer.

    readUtf8: (size?: number) => string

    Reads a UTF-8 string from the data view.

    Type Declaration

      • (size?: number): string
      • Parameters

        • Optionalsize: number

          The size of the string in bytes.

        Returns string

        The UTF-8 string.

    slice: (size: number) => IsoView

    Creates a new IsoView instance with a slice of the current data view.

    Type Declaration

      • (size: number): IsoView
      • Parameters

        • size: number

          The size of the slice.

        Returns IsoView

        A new IsoView instance.

    Accessors

    • get bytesRemaining(): number
      Beta

      The number of bytes remaining in the data view.

      Returns number

    • get cursor(): number
      Beta

      The current byteoffset in the data view.

      Returns number

    • get done(): boolean
      Beta

      Whether the end of the data view has been reached.

      Returns boolean

    Methods

    • Beta

      Iterates over the boxes in the data view.

      Returns Generator<IsoBmffBox>

      A generator of boxes.