Skip to content
Strife Docs

Reference Fields

Video

The Video field lets editors embed a video in a document from a media asset, a direct URL. It stores the source, playback options, and an optional poster image as an object in the database.

Settings

The Video field does not feature any distinctive template-level settings beyond the standard ones. When editing a document, the field's built-in editor offers a source selector (Media or URL), quality toggle, poster image editor, and playback controls (autoplay, loop, mute, controls, start time).

Note:

You can find a comprehensive list of all basic settings in the 'Overview' section.

Define with JSON

When defining templates using JSON, this field is represented using:

  • Component Name: str-video
  • Type: video
  • Reference ID: str-video|video
JSON
{
  ...
  "editor": {
    "name": "str-video",
    "type": "video",
    "propertyName": "..."
  },
  ...
}

The value stored in the database is an object describing the selected video:

JSON
{
  "source": "media",           //"media" | "url"
  "url": "...",                  //Video URL
  "quality": "high",             //"medium" (720p) or "high" (1080p) for Media source
  "poster": {                    //Optional poster image
    "src": "...",
    "alt": "",
    "width": 1366,
    "height": 768
  },
  "startTime": "0",              //Start offset in seconds
  "playing": false,              //Autoplay
  "muted": false,
  "controls": true,
  "loop": false
}

Live preview

This field does not have a default Strife Web Component. To render a video in live preview, read url, poster, and the playback flags from the stored value and render a native <video> element.

Note:

For more information on live preview and custom implementations, please refer to the Live preview documentation.