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 lets you pick a video from Media, describe it, and set its playback: start time, autoplay, loop, mute and controls. The poster is the video's own thumbnail.

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": "1",                 //"1" = Media, "2" = a pasted URL (older values only)
  "url": "https://vz-example.b-cdn.net/<video id>/play_720p.mp4",
  "zone": "https://vz-example.b-cdn.net",
  "guid": "<video id>",
  "library": 12345,
  "startTime": 12.5,             //Seconds; older values store a string such as "12.5"
  "playing": false,              //Autoplay
  "muted": false,
  "controls": true,
  "loop": false,
  "thumbnail": "https://vz-example.b-cdn.net/<video id>/thumbnail.jpg",
  "description": "A product walkthrough",
  "width": 1920,
  "height": 1080,
  "duration": 51.5
}

Values saved by older versions of the editor carry only part of this, and may also hold quality and poster. The full read type, and videoSources() for building playback URLs, are in fields.video().

Live preview

This field does not have a default Strife Web Component. To render a video in live preview, build the URLs with videoSources() and render a native <video> element.

Note:

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