video()
Purpose: Spawn and control HTML5 video overlays during a score.
Required
file:Filename with optional extension (.mp4default if missing). Supportsmp4|webm|ogg.
Placement & Positioning
location:fixed(default) |scrollfixed→ pinned to viewport.scroll→ follows target/score scroll.
target:<elementId>— centers the video on the target (if not fullscreen).offsetX:/offsetY:pixel offsets applied after centering.
Size
size:fsorfullscreen→ covers viewport at(0,0)with100vw×100vhand passes clicks through by default.<W>(e.g.640) → width in px, auto height.<W>x<H>(e.g.640x360).
Audio (Default Muted)
audio:0|1|true|false— default is muted. Setaudio:1(ortrue) to unmute.
Spawning / Reuse
- By default, cues reuse an existing video matching the same
file + target. uid:<string>ornew:1→ force a new concurrent instance (even if one exists).- Every instance receives
data-uidfor tracking;data-key=file_target.
Timing & Playback
in:seconds (seek start)out:seconds (optional fade-out scheduling; pairs well withfadeOut)hold:seconds (auto-remove after this duration, regardless of loop)loop:0= infinite;N= loop count; omit = play oncespeed:playback rate (e.g.0.5,1.25)opacity:0..1(default1)fadeIn:seconds;fadeOut:seconds
Interaction
- Fullscreen (
size:fs): usespointer-events:noneso the score behind remains draggable/clickable.- Add
clickable:1to allow clicks on the fullscreen video (e.g., to close on click).
- Add
- Non-fullscreen videos remain clickable; single-click removes them by default.
Removal
- Ends when:
- playback completes (no loop) or
loopcount is reached orholdexpires or- user clicks (non-fs) / double-click overlay (if you implement) / explicit cue cleanup.
Examples
-
Fullscreen, pass-through clicks, but allow click-to-close
cue:video(file:intro.mp4,size:fs,clickable:1,audio:1,fadeIn:0.5) -
Windowed, anchored to a target, follows scroll, infinite loop
cue:video(file:clip.webm,target:markerA,location:scroll,size:640x360,loop:0,opacity:0.9) -
Spawn a second independent instance via
uidcue:video(file:cam.mp4,uid:stageLeft,in:5,fadeIn:1,fadeOut:1,hold:20) -
Force new instance without specifying uid
cue:video(file:teaser.mp4,new:1,in:2,out:10,fadeIn:0.5,fadeOut:0.5,speed:1.25)
Note:
size:fsalways positions at(0,0)and ignores target geometry; all other sizes center ontarget(or the cue position) with optionaloffsetX/offsetY. Default audio is muted; useaudio:1to unmute. By default, samefile+targetcues reuse the existing element unlessuidornew:1is supplied.