decktalk-runtime.jsimplements the contract. A page can also follow it by hand.- The URL of a page picks one of four modes.
- The recorder hides the page under a magenta cover, then starts the page clock at narration t=0.
- Each step mounts at the earliest cue it owns, and each cue fires at its cue time.
- Your CSS styles the slides. The runtime adds only the stage element (
#dt-stage), slide transitions, and reveal effects.
Modes
A page holds scenes, and a page section plays one scene. A scene has steps, and each step renders one slide. A page plays in one of four modes, andwindow.__decktalk.mode holds the mode value.
Modes in the runtime reference lists the URL, the clock, and what
mounts in each mode.
Browser preview and recording
A browser preview opens the page without?beats=, so it plays in autoplay. A recording plays in
cue mode. This table shows which values matter in each.
data-at defaults to 0. So a browser preview shows a data-cue element with no data-at as soon
as its step mounts, before its cue.
The handshake
Witht0=signal in the URL, the page starts its clock only when the recorder calls
DeckTalk.startClock(). A browser preview has no t0=signal, so its clock starts at the load
event.
The recorder wait comes after window.__sceneReady resolves and before the recorder removes the
cover. Two [record] settings set it.
settle_seconds = 0.5 and min_lead_seconds = 1.5. The cover hides the page
during the wait. How it works explains why the
first frame after the cover is narration t=0.
From the first paint until the recording stops, the recorder keeps a 2 px square turning in the
bottom-right corner at 3 % opacity. The square keeps the browser drawing frames at the same pace
before and after t=0. A still page then records each reveal on its scheduled frame, not a frame or
two early. The square is too faint for verify or check to measure, and decktalk shots never
shows it. A page needs no motion of its own for timing.
A page that starts its own clock at load fires every cue early, by the whole time from load to
t=0. Every reveal in the video then comes before its word.
After the recording, the recorder reads these values from the page and writes them to the sidecar:
window.__decktalk.warnings. The recorder also logs each warning.- The page’s uncaught errors. A missing or empty
window.__decktalk.catalogcounts as one more error. window.__decktalk.frameGaps.window.__decktalk.syncLog.
check stage reports PAGE ERROR for a page error. It reports KATEX? for a warning that
mentions KaTeX or data-tex. decktalk check lists every verdict.
Cue ownership
Each cue in?beats= has one owner, a step of the playing scene. The runtime picks the owner with
three rules.
- A step whose id equals the cue id owns the cue.
- A step whose
cueslist or object names the cue owns the cue. - Otherwise, the step whose id is the longest prefix of the cue id owns it. For example, step
4.2owns cue4.2b1, and step9owns cue9a.
- A step mounts at the earliest cue time it owns.
- The first step to mount does so at t=0, even when its earliest cue is later.
- A step that owns no cue in
?beats=never mounts. - The last step to mount stays until the recording ends.
cues.json, the page, and its steps adds a warning.
Cue mismatches lists each one, with its result.
When a cue fires
When a cue fires, the runtime adds its id towindow.__decktalk.fired. Then it does three things,
in this order:
- Every element on the mounted slide whose
data-cuematches the cue appears. - The mounted step’s
on[id]handler runs, if the step has one. - Every handler that
DeckTalk.on(id, fn)registered for the cue runs, in the order of registration.
{ id, at, frozen, step }. A handler
finds its elements with slide.querySelector and needs no global variable.
Handler context describes the fields. An element with
data-sync starts to show its words one at a time when it appears.
Build artifacts a page can read
A page gets its cue times as?beats=, from build/audio/beats.json. It gets the section’s spoken
words as ?words=, and the words of the section before it as ?prevwords=, both from
build/audio/timeline.json. A tool of your own can read those files too.
Build artifacts has the shape of each file.
Terms
Next
- Write your first page: Your first deck
- Size a slide and choose reveal effects: Design a slide
- Look up every attribute and field: Runtime