ReferenceText tracks
muxStoryboard
A converter that turns a Mux storyboard JSON file into thumbnail cues
Import
muxStoryboard reads a Mux storyboard JSON file, https://image.mux.com/{playbackId}/storyboard.json, and returns cues for a thumbnails track. Pass it as the format of a { kind: 'metadata', label: 'thumbnails' } track with a src, and the player converts the file once it loads. Or call it with the file’s text or parsed JSON and pass the result as cues.
MuxVideo already adds the storyboard as a WebVTT <track>, so you don’t need this with it. Use it when you play a Mux asset through other media, or fetch the storyboard yourself.
Usage
Cues
Each tile in the file’s tiles becomes one cue, in order of its start. A cue runs to the next tile’s start, and the last one to the storyboard’s duration. Tiles without a numeric start, x, and y are skipped, and a file that isn’t a storyboard gives no cues; only text that isn’t JSON throws.
Each cue’s value is a ThumbnailCueValue, which the thumbnail components read in place of a media fragment in the cue’s text: