ef-trim-handles

Draggable start/end trim handles. Overlays onto a thumbnail strip or track.

Renders draggable in/out handles with dimmed overlay regions. Fires trim-change events as the user drags. Typically layered over an ef-thumbnail-strip.

<div style="position: relative; height: 56px;">
  <ef-thumbnail-strip target="my-video" use-intrinsic-duration thumbnail-height="56"
    style="display: block; width: 100%; height: 56px;"></ef-thumbnail-strip>
  <ef-trim-handles intrinsic-duration-ms="5000" seek-target="my-video"
    style="position: absolute; inset: 0;"></ef-trim-handles>
</div>
document.querySelector('ef-trim-handles').addEventListener('trim-change', (e) => {
  const { startMs, endMs } = e.detail.value;
});

CSS custom properties:

PropertyDefaultDescription
--trim-handle-width8pxHandle bar width
--trim-handle-colorrgba(255,255,255,0.7)Handle color
--trim-handle-active-color#3b82f6Handle color while dragging
--trim-overlay-colorrgba(0,0,0,0.4)Dimmed region color