Skip to main content

Video

A video component is used to display video content and an optional video caption consistently.

A video caption provides context about the video, if necessary. The “Download video transcript” link allows the user to download a .txt file transcription of the video content.

Example

<video
aria-label="Lorem Ipsum"
class="bux-video"
src="/images/placeholders/hero-video-clip.webm"
controls
>
<track
label="English"
kind="captions"
srclang="en"
src="/text/placeholder-captions.vtt"
default
/>
</video>

<div class="bux-video-transcription">
<div class="bux-link-container bux-link-container--before">
<a
class="bux-link bux-link--before"
href="/text/placeholder-text.txt"
target="_blank"
>
Download video transcript
</a>
</div>
</div>

Usage

Dos

  • Include a video caption for additional context and/or source attribution, if possible

Don’ts

  • Do not autoplay video content.

Implementation Notes

Video Sources

  • You can provide multiple video sources (mp4, webm, ogv) and browsers will select the first source that works.

Captioning/Subtitles

  • Closed captions and subtitles can be included by adding track elements within the <video> element. The native HTML <video> element will recognize these tracks and display captioning options in the player controls.
  • Only one track should have the default attribute. This determines which track is enabled by default when the video loads.
  • Track files must be in WebVTT format (.vtt file extension).

Figure Captioning

  • A <figcaption> should not serve as a replacement for video captioning/subtitles and should only serve to provide additional context.

Accessibility

  • Captions and Transcripts for Video
  • Videos having caption text that describe the video need to have their caption associated with the video using the <figure> and <figcaption>. This is different than the closed captions for the video content.
  • Ensure that the Video Caption component is never used outside of a<figure>element
Back to top