Video

ReferenceSchema API

s.video()

One video with its poster, captions, and start and end times, as an mp4 or an HLS stream.

Use it for

  • Hero videos and product demos
  • Video that streams at the right quality for the viewer

Reference

s.video(options?)

schema

One video: an .mp4 or .webm file, or an HLS stream. width, height and duration are read from the file. A poster, start and end times, a focal point, alt text and captions are set by editors in the Studio.

Pass a s.videodir() module instead of options to let editors pick from that library.

In Val Studio

Options

stream{ type: "hls" }

{ type: "hls" } turns an upload into an HLS stream, transcoded in the browser, so viewers get the quality their connection can take.

s.video({ stream: { type: "hls" } })

Methods

.remote()

Store the video on Val's CDN instead of in git.

Example

Rendering it

TypeScript
const schema = s.object({ intro: s.video() });

// in a component
<ValVideo video={page.intro} />