@rendley/sdk - v1.15.5
    Preparing search index...

    Class ZipArchive

    Convenience wrapper around FFmpeg archive operations for creating, reading, and extracting zip-like archives.

    Index

    Constructors

    • Creates an archive helper bound to a specific FFmpeg instance.

      Parameters

      • Optionalffmpeg: FFmpeg

        Optional FFmpeg instance. When omitted, the engine singleton FFmpeg instance is used.

      Returns ZipArchive

    Methods

    • Adds an in-memory byte buffer to the open archive.

      Parameters

      • path: string

        Target file path inside the archive.

      • data: Uint8Array

        Byte buffer to write.

      • takeOwnership: boolean = false

        When true, reuses the provided buffer instead of cloning it first.

      Returns Promise<boolean>

      A promise that resolves to true if the data was added successfully.

    • Adds a file from the FFmpeg virtual filesystem to the open archive.

      Parameters

      • path: string

        Source file path to add.

      • targetDirectory: string = ""

        Optional directory inside the archive where the file should be placed.

      Returns Promise<boolean>

      A promise that resolves to true if the file was added successfully.

    • Adds multiple files from the FFmpeg virtual filesystem to the open archive.

      Parameters

      • paths: string[]

        Source file paths to add.

      • targetDirectory: string = ""

        Optional directory inside the archive where the files should be placed.

      Returns Promise<boolean>

      A promise that resolves to true if the files were added successfully.

    • Closes an archive handle.

      Parameters

      • id: number

        Archive handle identifier to close.

      Returns Promise<boolean>

      A promise that resolves to true if the archive was closed successfully.

    • Creates a new archive file and opens it for subsequent operations.

      Parameters

      • path: string

        Output archive path in the FFmpeg virtual filesystem.

      Returns Promise<boolean>

      A promise that resolves to true if the archive was created successfully.

    • Closes the currently open archive if one is active.

      Returns Promise<undefined | boolean>

      A promise that resolves to the FFmpeg close result, or undefined if no archive is open.

    • Extracts all archive contents into the specified directory.

      Parameters

      • path: string

        Destination directory in the FFmpeg virtual filesystem.

      Returns Promise<boolean>

      A promise that resolves to true if extraction completed successfully.

    • Extracts a single archived file to a destination path.

      Parameters

      • fromPath: string

        File path inside the archive.

      • toPath: string

        Destination path in the FFmpeg virtual filesystem.

      Returns Promise<boolean>

      A promise that resolves to true if the file was extracted successfully.

    • Returns the FFmpeg instance used for archive operations.

      Returns FFmpeg

      The bound FFmpeg instance.

    • Indicates whether an archive is currently open.

      Returns boolean

      true if the archive helper has an active archive handle; otherwise false.

    • Lists the files currently stored in the open archive.

      Returns Promise<string[]>

      A promise that resolves to the archive file path list.

    • Opens an existing archive file.

      Parameters

      • path: string

        Archive path in the FFmpeg virtual filesystem.

      Returns Promise<boolean>

      A promise that resolves to true if the archive was opened successfully.

    • Reads a single file from the open archive.

      Parameters

      • path: string

        Path of the archived file to read.

      Returns Promise<null | Uint8Array<ArrayBufferLike>>

      A promise that resolves to the file bytes, or null if the read fails.

    • Flushes pending changes to the currently open archive.

      Returns Promise<boolean>

      A promise that resolves to true if the archive was saved successfully.