If you want captions or subtitles to appear in your embedded player by default, you can do so by adjusting the embed code before placing it on your site. Note that it's not possible to set captions or subtitles to appear by default for video pages on vimeo.com (e.g https://vimeo.com/76979871), or when embedding videos in applications that do not allow insertion of our embed code.
In this article:
- Enable captions by default in fixed embed code
- Enable captions by default in a responsive embed code
- Enable autogenerated captions by default
- About language preference in the text track parameter
Enable captions by default in fixed embed code
Add the following text track parameter to the end of the player URL in your embed code:
?texttrack=
For example, if you want to turn on French subtitles or captions by default, your embed code should look like this:
<iframe src="https://player.vimeo.com/video/641672376?h=2f9fb9efe9&texttrack=fr
&badge=0&autopause=0&player_id=0&app_id=58479"
width="1920" height="1080" frameborder="0" allow="autoplay; fullscreen; picture-in-picture"
allowfullscreen title="This is the Video Title"></iframe>
To add the text track when a privacy hash is present in the embed code, you should add an &
between query parameters (h
, texttrack
) as in the above example.
Enable captions by default in a responsive embed code
Add the following text track parameter to the end of the player URL in your embed code:
?texttrack=
For example, if you want to turn on Spanish subtitles or captions by default, your embed code should look like this:
<div style="padding:56.25% 0 0 0;position:relative;">
<iframe src="https://player.vimeo.com/video/641672376?texttrack=es?badge=0&autopause=0&player_id=0&app_id=58479"
frameborder="0" allow="autoplay; fullscreen; picture-in-picture" allowfullscreen s
tyle="position:absolute;top:0;left:0;width:100%;height:100%;" title="This is the Video Title">
</iframe></div><script src="https://player.vimeo.com/api/player.js"></script></iframe></div><script src="https://player.vimeo.com/api/player.js"></script>
To add the text track when a privacy hash is present in the embed code, you should add an &
between query parameters (h
, texttrack
) as in the above example.
Enable autogenerated captions by default
To add auto-generated captions as in the embed code, you must add "texttrack=en-x-autogen".
For example:
<iframe src="https://player.vimeo.com/video/641672376?h=2f9fb9efe9&texttrack=en-x-autogen
&badge=0&autopause=0&player_id=0&app_id=58479"
width="1920" height="1080" frameborder="0" allow="autoplay; fullscreen; picture-in-picture"
allowfullscreen title="This is the Video Title"></iframe>
About language preference in the text track parameter
The language preference you set for the text track parameter must be represented by a lowercase ISO 639-1 language code. Optionally, you can also specify the locale and type of text track (examples: "en", "en-US", "en.captions", "en.subtitles"). You can find a list of standard language codes here.
Suppose you enter a language preference that hasn't yet been uploaded for your particular video. In that case, the text track parameter will be ignored, and your embedded video may load with CC or subtitles disabled by default. Also, please remember that viewers will still have the option to manually turn off or switch to a different language available for your video.