Player Customization

Adding subtitles and captions to your videos

Updated June 30, 2026

SmartVideo supports captions and subtitles in two ways: auto-imported from YouTube/Vimeo, or manually added via VTT/SRT files.

YouTube and Vimeo captions (auto-import)

If your video source is YouTube or Vimeo, SmartVideo can automatically import existing captions during the optimization process. The captions need to be enabled on the source video before SmartVideo processes it for the first time.

To enable YouTube caption import:

  • WordPress plugin: Go to SmartVideo settings and check the YouTube captions option
  • JavaScript snippet: Add youtubecaptions: true to your swarmoptions configuration

Important timing detail: SmartVideo imports captions at the moment it first processes the video. If you enable captions on YouTube after SmartVideo has already imported the video, the captions won’t appear automatically. To trigger a re-import, you have two options:

  1. Make a copy of the video on YouTube/Vimeo, wait for captions to be auto-generated and/or add manual captions, then swap the video on your site for this new version. SmartVideo will process the new version from scratch.
  2. Delete your current video, re-upload a new one, wait for it to fully process on YouTube/Vimeo with captions enabled, then place that new embed code on your site.

In both cases, make sure the file is fully processed on YouTube/Vimeo with captions turned on before swapping it onto your site, so SmartVideo picks up the captions on first sight.

Auto-imported captions from YouTube are currently English only.

Manual captions with VTT or SRT files

For full control over your captions, use the standard <track> element inside your SmartVideo tag. This works with VTT and SRT caption files.

<smartvideo src="video.mp4" width="1280" height="720" controls>
  <track default kind="captions" srclang="en" label="English" src="captions.vtt">
</smartvideo>

Multiple languages

You can add captions in multiple languages by including additional <track> elements. The one marked with default will be shown first, and viewers can switch between languages from the captions menu in the player controls.

<smartvideo src="video.mp4" width="1280" height="720" controls>
  <track default kind="captions" srclang="en" label="English" src="captions-en.vtt">
  <track kind="captions" srclang="es" label="Español" src="captions-es.vtt">
  <track kind="captions" srclang="fr" label="Français" src="captions-fr.vtt">
</smartvideo>

How captions show up in the player

  • One caption track: the player shows a single CC toggle on the control bar (or inside the three-dot overflow menu on narrow players). Tap it once to turn captions on, tap again to turn them off.
  • Multiple caption tracks: the CC button opens a submenu so viewers can pick a language or turn captions off.
  • No caption files: the CC option is hidden entirely — you won’t see a stray “Captions” entry on videos that don’t have any.

Quick reference

MethodLanguagesSetup
YouTube auto-importEnglish onlyEnable youtubecaptions: true before first import
Vimeo auto-importEnglish onlyEnable caption setting before first import
Manual VTT/SRTAny languageAdd <track> elements to your SmartVideo tag

For more details on the <track> element, see Mozilla’s reference documentation.

Keywords: captions, subtitles, VTT, SRT, track, YouTube captions, youtubecaptions, multiple languages, accessibility

Make the player yours

Match your brand with custom colors, a custom play button, captions, and more.

14-day free trial · No charge until day 15