Skip to content

Video Item

Renders a video clip on the canvas. Supports trimming, volume control, borders, masks, and corner radius.

Creating a Video Item

tsx
const { addItem } = useStudio()

addItem('Video', {
  x: 0,
  y: 0,
  width: 1280,
  height: 720,
  itemProps: {
    src: 'https://example.com/clip.mp4',
    start: 0,
    end: 10,
    duration: 10,
  },
})

Properties

All properties below are passed inside itemProps.

Source & Timing

PropertyTypeDescription
srcstringURL of the video file. Required.
startnumberTrim start time in seconds. Required.
endnumberTrim end time in seconds. Required.
durationnumberTotal duration of the source video in seconds. Required.
volumenumberPlayback volume from 0 to 1.

Border & Radius

PropertyTypeDescription
borderColorstringBorder color.
borderWidthnumberBorder thickness in pixels.
cornerRadiusnumberCorner radius in pixels.

Shadow

PropertyTypeDescription
shadowEnabledbooleanEnable or disable the shadow.
shadowColorstringShadow color.
shadowBlurnumberShadow blur radius.
shadowOffsetXnumberShadow horizontal offset.
shadowOffsetYnumberShadow vertical offset.

Mask

PropertyTypeDescription
svgMask{ path: string; viewBox: { x: number; y: number; w: number; h: number }; filename: string }SVG shape used as a clip mask.

Trimming Example

tsx
addItem('Video', {
  x: 0,
  y: 0,
  width: 1280,
  height: 720,
  itemProps: {
    src: 'https://example.com/interview.mp4',
    start: 5,    // trim to start at 5s
    end: 15,     // trim to end at 15s
    duration: 60, // source video is 60s long
    volume: 0.8,
  },
})

Notes

  • Video playback is synchronized with the timeline via usePlayer.
  • start and end control the trim within the source video file.

Released under a proprietary license.