ef-timegroup

The timing container. Every composition is a tree of timegroups.

AttributeReact propTypeDefaultDescription
durationdurationstringFixed duration when `mode="fixed"` (CSS time, e.g. `"5s"`); ignored in other modes.
fpsfpsnumberRendering frame rate.
looploopbooleanfalseLoop attribute — when this temporal is a self-driving root under a {@link PlaybackController}, the controller wraps back to `0` instead of pausing at `duration`.
modemodefixed | sequence | contain | fit"contain"Duration calculation mode.
offsetoffsetnumberStart offset (seconds) within a parallel (`fixed`/`contain`/`fit`) parent timegroup.
overlapoverlapnumberOverlap time between adjacent `sequence`-mode items (e.g. `"1s"`).
<ef-timegroup mode="sequence" class="w-[1920px] h-[1080px] bg-black">
  <ef-timegroup mode="fixed" duration="2s" class="absolute w-full h-full bg-indigo-900 flex items-center justify-center">
    <ef-text class="text-white text-6xl font-bold">Scene A — 2s</ef-text>
  </ef-timegroup>
  <ef-timegroup mode="fixed" duration="2s" class="absolute w-full h-full bg-rose-900 flex items-center justify-center">
    <ef-text class="text-white text-6xl font-bold">Scene B — 2s</ef-text>
  </ef-timegroup>
  <ef-timegroup mode="fixed" duration="2s" class="absolute w-full h-full bg-emerald-900 flex items-center justify-center">
    <ef-text class="text-white text-6xl font-bold">Scene C — 2s</ef-text>
  </ef-timegroup>
</ef-timegroup>

Slots

Events

EventDetailDescription
child-duration-changed{ duration: number }Fires on the nearest context-providing ancestor when a nested media element's duration becomes known or changes.

Public Methods

MethodDescription
addFrameTask(callback: FrameTaskCallback): () => voidRegister a per-frame callback; returns an unregister function.
waitForContentReady(): Promise<void>Waits for this timegroup and the temporal children that matter for the current presentation. Sequence mode only waits on the active scene(s) — waiting on every idle sibling was hanging Showcase export forever while later clips' `#load()` contended on shared registry Inputs.
seekForRender(time: number, options?: SeekForRenderOptions): Promise<void>`strictVideoPaint: true` additionally verifies every active `ef-video` descendant reached `HAVE_CURRENT_DATA` (i.e. actually painted a sample for this frame, not just resolved metadata) — retrying briefly before throwing. Costs a few extra microtask turns; use for final-render capture, not interactive preview. See base {@link TemporalElement.seekForRender} for the deterministic sync + content-readiness contract this builds on.