Video | AIUI | Rokid

video plays video resources and automatically pauses or resumes playback with page and viewport visibility.

Video

video plays video resources and automatically pauses or resumes playback with page and viewport visibility.

Play a Video

<video
  id="preview"
  src="https://example.com/video.mp4"
  poster="/assets/poster.jpg"
  autoplay="true"
  object-fit="contain"
  bindtimeupdate="handleTimeUpdate"
  bindended="handleEnded"
></video>

Properties

PropertyTypeDefaultDescription
srcString""Video resource URL.
posterString""Image shown before video frames are available.
autoplayBooleanfalseWhether playback starts automatically.
loopBooleanfalseWhether playback loops.
mutedBooleanfalseWhether audio is muted.
volumeNumber1Volume clamped to 0 through 1.
playback-rateNumber1Playback rate.
start-timeNumber0Initial playback position in seconds.
preloadStringmetadataPreload policy: none, metadata, or auto.
object-fitStringcontainFrame fitting: contain, cover, or fill.
render-modeStringnormalSet to wireframe to enable wireframe preview.

Wireframe mode also supports wireframe-threshold, wireframe-thickness, wireframe-invert, and wireframe-quality.

Events

Use bind<event> or catch<event> for loadstart, loadedmetadata, canplay, play, playing, pause, waiting, stalled, seeking, seeked, timeupdate, ended, volumechange, ratechange, and error. timeupdate returns { currentTime }; error returns { message }.

See Assets for local paths, network URLs, and object URL support.