DreamLake
Browse docs

Video

EpisodeVideoStack scrubs several camera views at one time. Add a shared clock for playback alongside charts and a timeline.

Standalone stack

Hover a tile to scrub all three views. This specimen repeats one clip; replace each src with a camera recording for your dataset.

REC · 00:00.000
front/camera/front/image_compressed
REC · 00:00.000
wrist/camera/wrist/image_compressed
REC · 00:00.000
top/camera/top/image_compressed
Code StandaloneSpec.tsx
tsx
<EpisodeVideoStack
  duration={duration}
  videos={[
    { id: "front", title: "Front", src: "/front.mp4" },
    { id: "wrist", title: "Wrist", src: "/wrist.mp4" },
  ]}
  columns={2}
/>

A source without src renders a placeholder. The accent ring identifies the active camera.

Tile labels and size

Use the show* props to choose timestamps, labels, subtitles, resolution, and a live indicator. Resolution and aspect ratio come from loaded video metadata; set tileAspect to keep differently sized sources in a uniform grid.

Playback

Wire one TimelineClock to the video and controls:

tsx
const { clock, state, play, pause, seek } = useTimeline(duration)
const time = useClockValue(30, clock)

<ClockProvider clock={clock}>
  <EpisodeVideoStack videos={videos} duration={duration} time={time} onHover={seek} />
</ClockProvider>
<button onClick={state.playing ? pause : play}>
  {state.playing ? 'Pause' : 'Play'}
</button>

This example seeks the clock on hover, so playback resumes from the last scrubbed time. With ClockProvider, tiles use native playback and resynchronize after seeks, loops, or drift. A buffering tile holds the shared clock and can pause the group. Schema-driven DatasetPreview supplies this clock for you.

Hand keypoint overlays

Attach skeletons, detections, or captions through a source's overlays. This video combines hand joints with task labels:

REC · 00:00.000
Ceramicsclaru_ego · hand skeletons + subtask captions
Code HandJointsSpec.tsx

Overlays follow the presented frame by default. See Media overlays for coordinates and lookup timing.

Combined with EpisodeTimeline

Hover either surface to inspect the same time. activeId separately records the selected camera.

REC · 00:00.000
front/camera/front/image_compressed
REC · 00:00.000
wrist/camera/wrist/image_compressed
REC · 00:00.000
top/camera/top/image_compressed
1.00×
Code CombinedSpec.tsx

Cursor emphasis

The hovered surface has a bright cursor. Moving to the timeline mutes the video cursor lines; the selected camera can keep its ring.

Remember a camera

Wire activeId and onActiveChange to shared state. Clear it in onHoverEnd for hover-only selection, or retain it to remember the camera. Uncontrolled stacks remember the last entered tile; defaultActiveId sets the initial one.

Media sources and time windows

Video support follows the browser's codecs. HLS and DASH need browser support or a playback integration. Tile clicks do not seek; use the timeline's onSeek for click-to-commit behavior.

For an episode inside a longer file, set VideoSource.window to { from, to } in file seconds. Episode time zero maps to from, and playback stops at to. Use episode-relative duration and time in paired panels.

Props

PropTypeDefaultPurpose
videosVideoSource[]requiredCamera views, in display order.
durationnumberrequiredEpisode length in seconds; use the same length for paired views.
timenumber | nullnullShared cursor or playhead time. Null hides the cursor.
onHover(t: number) => void—Receive the hovered time.
onHoverEnd() => void—Receive pointer leave from the whole grid, not gaps between tiles.
activeIdstring | null—Controlled active camera.
defaultActiveIdstring | nullnullInitial camera when uncontrolled.
onActiveChange(id: string) => void—Receive entry into a camera tile.
columns / gapnumber3 / 6Column count and gap in pixels.
tileAspectnumberintrinsicTile width / height; uses 16:9 until metadata loads.
showRecTimestampbooleantrueShow the timestamp.
showLivebooleanfalseShow the live indicator.
showLabelbooleantrueShow camera title and subtitle.
showResolutionbooleantrueShow dimensions after metadata loads.
showOverlaysbooleantrueShow source annotation layers.
overlaySync'media' | 'cursor''media'Follow the presented media frame or supplied time for overlays.
classNamestring—Root CSS classes.

VideoSource

FieldTypePurpose
idstringStable camera identifier, matched by activeId.
srcstringVideo URL; omit for a placeholder.
title / subtitlestringCamera name and additional source label.
posterstringImage shown before the video loads.
window{ from: number; to: number }Episode bounds in the source file's seconds.
overlaysMediaOverlay[]Annotation layers, drawn in array order.