Luxar Viewer API Documentation - v2026.9.22
    Preparing search index...
    Index
    streamingZip: Zip | null = null
    chunks: Uint8Array<ArrayBufferLike>[] = []
    totalBytes: number = 0
    diskFailed: boolean = false
    writable: FileSystemWritableFileStream | null = null
    setupCalled: boolean = false
    frameSequenceNumber: number = 0

    Output frame sequence counter. Increments after each successful addFrame so output names are contiguous even when source frames fail. See addFrame docstring for why this matters.

    pendingWrites: Promise<void>[] = []

    Pending disk write promises (File System Access API path). The ZIP chunk callback fires writes asynchronously; finalize() awaits them before close() to avoid racing close-with-pending-writes and to surface write failures the .catch handler trapped.

    logError: (msg: string) => void
    • Start the ZIP stream. Tries to obtain a disk handle from showSaveFilePicker; on failure or unavailability, falls back to in-memory accumulation. Always succeeds — disk failures are folded into in-memory mode, and a user-cancelled picker also falls back rather than aborting the whole capture.

      Parameters

      Returns Promise<void>

    • Append a single frame to the ZIP. Frame names are zero-padded to 6 digits and use a private sequence counter that increments only on successful adds, so the output sequence is always contiguous (frame_000000, frame_000001, …) regardless of which source frame indices the caller skipped or had errors on. The bundled ffmpeg script in encode_video.sh assumes a contiguous sequence.

      Parameters

      • data: Uint8Array
      • ext: string

      Returns void

    • Finalize the ZIP stream. Behaviour:

      • on disk-failed: end the stream, abort the writable, toast the error.
      • on zero captured frames: end the stream, abort the writable, toast.
      • otherwise: append the ffmpeg script, end the stream, await all pending writes, then close the writable OR build an in-memory blob and download it.

      Writes are awaited via Promise.allSettled so a late rejection sets diskFailed and we can take the failure-toast path even if the .catch handler hadn't yet flipped the flag at the time end() returned.

      Parameters

      Returns Promise<void>

    • Tear down a partial ZIP without delivering an artifact. Called by the panel when the offline session is aborted (disposed / cancelled / capture errored). Idempotent: safe to call after finalize, after abort, or on a never-set-up instance.

      Returns Promise<void>