Protected_The currently-held chapter list (may not yet be loaded from disk).
Protected_Whether chapters have been loaded from disk at least once.
Protected_Whether the in-memory chapter list differs from what is on disk.
Returns true if the in-memory chapter list has been modified.
Returns the held chapter list without triggering a disk read. Useful for mock implementations in tests.
Returns the chapter list, reading from disk on first call.
The MP4 file stream.
The chapter list (start times in ms).
Reads QuickTime chapters from the chapter text track.
The MP4 file stream.
true if a chapter track was found and parsed.
Removes the QuickTime chapter track (if present) from the file.
The MP4 file stream.
true on success (including when no chapter track exists).
Writes the chapter list to disk only if it has been modified.
The file stream.
true if successful (or if no write was needed).
Updates the chapter list, marking it as modified if the new list differs from the current one or if the holder was not yet loaded.
Replacement chapter list.
Sets _modified directly (used in tests / mock subclasses).
New modified state.
Writes QuickTime chapters as a new text track, replacing any existing one. Writing an empty list removes the chapter track.
The MP4 file stream.
true on success.
Reads, writes, and removes QuickTime-style chapter tracks from MP4 files.
A QT chapter track is a disabled text track (
hdlrtype"text") referenced by achaptrack-reference in the audio track'strefbox.Implements the lazy-read / dirty-write pattern via Mp4ChapterHolder.
Example