taglib-ts
    Preparing search index...

    Reads, writes, and removes QuickTime-style chapter tracks from MP4 files.

    A QT chapter track is a disabled text track (hdlr type "text") referenced by a chap track-reference in the audio track's tref box.

    Implements the lazy-read / dirty-write pattern via Mp4ChapterHolder.

    const holder = new QtChapters();
    const chapters = await holder.getChapters(stream);
    holder.setChapters([{ title: "Intro", startTime: 0 }]);
    await holder.saveIfModified(stream);

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    _chapters: Mp4Chapter[] = []

    The currently-held chapter list (may not yet be loaded from disk).

    _loaded: boolean = false

    Whether chapters have been loaded from disk at least once.

    _modified: boolean = false

    Whether the in-memory chapter list differs from what is on disk.

    Accessors

    • get isModified(): boolean

      Returns true if the in-memory chapter list has been modified.

      Returns boolean

    Methods

    • Removes the QuickTime chapter track (if present) from the file.

      Parameters

      Returns Promise<boolean>

      true on success (including when no chapter track exists).

    • Writes QuickTime chapters as a new text track, replacing any existing one. Writing an empty list removes the chapter track.

      Parameters

      Returns Promise<boolean>

      true on success.