ef-video

Renders a video clip with optional source trim.

Renders a video clip. Use sourcein and sourceout to trim the source file.

AttributeReact propTypeDefaultDescription
durationdurationstringHow long this element is active (CSS time, e.g. `"5s"`).
fft-decayfftDecaynumber8Decay frames averaged into {@link getFrequencyData} (default 8).
fft-gainfftGainnumber3Linear gain applied before frequency analysis (default 3.0).
fft-sizefftSizenumber128FFT window size for {@link getFrequencyData}/{@link getTimeDomainData} (rounded to a power of two, default 128).
file-idfileIdstring | nullCloud file identifier — resolves to `${apiHost}/api/v1/files/${fileId}`, taking priority over `src`/`variants`.
interpolate-frequenciesinterpolateFrequenciesbooleanfalseSmooths {@link getFrequencyData} bins by interpolating between FFT bands instead of nearest-neighbor sampling.
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`.
mutemutedbooleanfalseMutes the video's audio track.
offsetoffsetnumberStart offset (seconds) within a parallel (`fixed`/`contain`/`fit`) parent timegroup.
play-roleplayRolelow | high"high"Preferred variant-ladder quality tier during playback (as opposed to scrub).
sourceinsourceinstringStart time within the source file (CSS time, e.g. `"1.5s"`).
sourceoutsourceoutstringEnd time within the source file (CSS time, e.g. `"1.5s"`).
srcsrcstringURL of the source video file.
trimendtrimendstringTrims this much off the end of the source (CSS time).
trimstarttrimstartstringTrims this much off the start of the source (CSS time).
variant-modevariantModesingle-high | scrub-upgrade | multi-bitrate | scrub-plus-ladder"scrub-upgrade"Variant-ladder role-selection strategy when {@link variants} is set.
variantsvariantsstring""URL of a variant-ladder manifest (multiple resolutions/bitrates), used instead of `src`.
volumevolumenumber1Audio volume (0.0 to 1.0).

Use CSS object-fit: cover | contain | fill to control how the video fills its box.

<ef-timegroup mode="fixed" duration="8s" class="w-[1920px] h-[1080px]">
  <ef-video
    src="https://assets.editframe.com/bars-n-tone.mp4"
    sourcein="2s"
    sourceout="10s"
    class="absolute inset-0 size-full"
    style="object-fit:cover;"
  ></ef-video>
  <ef-text
    duration="3s"
    offset="1s"
    class="absolute bottom-16 left-16 text-white text-5xl font-bold drop-shadow-xl"
  >
    trimmed clip, 2s–10s
  </ef-text>
</ef-timegroup>

CSS Parts

PartDescription
canvasThe frame-rendering canvas (a light-DOM child, not shadow DOM).

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.
variantchange{ role: "scrub" | "low" | "high"; url: string; window: number | null }Fires when the active decode variant (role/URL/scrub window) changes.