video Object

Video object for use within content template displays.

Attributes

Attribute Required Description
Base file attributes
title Yes string Title of file.
description No number Description of file.
url Yes string URL where original file is stored/downloadable.
extension Yes string Extension of file. For example, mp4.
url_slug Yes string File name minus extension.
content_type Yes string MIME type of file. For example, video/mp4.
file_size Yes number Size of file in bytes.
keywords No string List of keywords to describe file.
downloadable? Yes boolean Whether or not the content author specified to include a download link to this file.
published_at No date Timestamp of when file was first published.
created_at Yes date Timestamp of when file was created.
updated_at Yes date Timestamp of when file was last updated.
id Yes number ID of file.
video block-specific attributes
embeddable? Yes boolean Whether or not the content author specified to embed this video directly onto the page through a video player.
embed_urls Yes array Collection of web-friendly embed_urls, particularly useful for building a group of <source> tags within the HTML5 <video> tag.
width Yes number Width of video in pixels.
height Yes number Height of video in pixels.
duration_in_ms Yes number Duration of video in milliseconds.
video_frame_rate Yes number How many frames per second video displays at.
video_codec Yes string Codec used to encode video.
video_bitrate Yes number Bitrate of video in kilobytes per second.
audio_codec Yes string Codec used to encode audio.
audio_sample_rate Yes string Audio sample rate.
audio_channels Yes number Number of channels of audio.
audio_bitrate Yes number Bitrate of audio in kilobytes per second.

Category

Block Objects

Description

The video block object defines the blueprint for content blocks based on the base video content template.

Within your content templates’ displays, you would reference the block’s var_name containing the video data. (It won’t necessarily be named video but rather what you defined in the content_templates.json file.)

Here is an example display template using a video content block with a var_name of trailer:

      {% comment %}
        HTML5 <video> tag with web-friendly embed URLs.
      {% endcomment %}
      {% if trailer.embeddable? %}
        <div class="video-player">
          <video preload width="{{ trailer.width }}" height="{{ trailer.height }}">
            {% for embed_url in trailer.embed_urls %}
              <source
                type="{{ embed_url.content_type }}"
                src="{{ embed_url.url }}"
              >
            {% endfor %}
          </video>
        </div>
      {% endif %}
      
      {% comment %}
        Link to download mp4 version of video file.
      {% endcomment %}
      {% if trailer.downloadable? %}
        <p class="file-download">
          Download:
          {% for embed_url in interview.embed_urls %}
            {% if embed_url.extension == 'mp4' %}
              <a href="{{ embed_url.url }}">
                {{ trailer.title }} ({{ embed_url.extension }})
              </a>
              {% break %}
            {% endif %}
          {% endfor %}
        </p>
      {% endif %}
      

Example Output

      <div class="video-player">
        <video preload width="1280" height="1040">
          <source
            src="//cdn.liveeditorapp.com/000/001/613/episode-vii.mp4"
            type="video/mp4"
          >
          <source
            src="//cdn.liveeditorapp.com/000/001/613/episode-vii.ogv"
            type="video/ogg"
          >
          <source
            src="//cdn.liveeditorapp.com/000/001/613/episode-vii.webm"
            type="video/webm"
          >
        </video>
      </div>
      
      <p class="file-download">
        Download:
        <a href="//cdn.liveeditorapp.com/000/001/613/episode-vii.mp4">
          Episode VII (mp4)
        </a>
      </p>