Video

A video with controls, full width.

Overview

Showing a recording or a walkthrough that your app serves.

Captions

Do
import { Video } from "@hackcove/ui";

<Video src="/media/walkthrough.webm" captions="/media/walkthrough.vtt">
  Your browser cannot play this video.
</Video>
captions is a WebVTT file offered as the default track; children is the text for a browser that cannot play it.
Don't
import { Video } from "@hackcove/ui";

<Video src="/media/walkthrough.webm" />
A video with speech and no captions leaves out anyone who cannot hear it.

Usage

  • src is your own video file. It loads only the metadata until it is played, so the page does not pull the whole file.
  • Give a captions WebVTT file for any video with speech; it is offered as the default track.
  • poster is the image shown before play; use a local one.
  • The children are the text for a browser that cannot play the video.

Accessibility

  • A native <video controls>: play, seek, volume and fullscreen work by keyboard through the browser's controls.
  • captions adds a <track kind="captions" default>, so captions are on by default.

API

Video

A <video> with controls, full width and rounded; it loads metadata only, so the page does not pull the file until it is played. src is the app's own video; captions is a WebVTT file, offered as the default track. children is the fallback for a browser that cannot play it.


captions
Type
string

src required
Type
string