In this week's Creator's Tip, we are going to show you how to force closed captions to appear on YouTube videos, both for videos that play on YouTube and for those that are embedded on your website or other people's blogs. Why would you want to do this? Well, let's say that you made a video and uploaded it to YouTube but the audio is a little quiet or not of the quality you want. Or perhaps the audio is OK but the person in front of the camera speaks very quickly, or with a strong accent. Maybe it's a music video and you want the viewers to see the lyrics as it's playing. If you upload a captions file to YouTube then you can 'force' viewers to have those captions displayed as they watch:

How To Force Closed Captions On Your Videos

#1) To force the video to show the closed caption file you uploaded then add yt:cc=on as a tag to that particular video.

ytcctag

#2) If you are going to embed this video on your website,

and you want to force the closed captions to be on then you need to add the following to the end of the URL that sits inside the iframe - cc_load_policy=1

Like so:

<iframe width="640" height="360" src="//www.youtube.com/embed/nsTrcipKBcg?cc_load_policy=1" frameborder="0" allowfullscreen></iframe>

How to Force Closed Captions in Other Languages

If you want to keep your English closed captions file as the default for the video but force your Spanish or German subtitles on your website embeds then you'll need to add something extra to the URL. For instance, to force Spanish closed captions on a video (if you have uploaded that particular language file of course), just add “&hl=es&cc_lang_pref=es” before the “&cc_load_policy=1” to the video’s embed code:

- “hl” sets the language for all features within the YouTube video.
- “cc_lang_pref” sets the language for the captions shown in the video.

So, if we had Spanish closed captions for the video below, and we wanted to force them because we were embedding them on a relevant page, we would extend the URL like so:

<iframe width="640" height="360" src="//www.youtube.com/embed/nsTrcipKBcg&hl=es&cc_lang_pref=escc_load_policy=1" frameborder="0" allowfullscreen></iframe>

This is really handy for international websites where you can show the same video content across different versions of your site, but use the correct language for each region. You can see a list of language codes here.

More Info on YouTube Player Parameters

Let us know in the comments below how you might use this feature.

  • http://nsputnik.com nsputnik

    The way this works today 4/2015 (and you know things always change) is if you have multiple caption languages enabled and the visitor has their YouTube language preference (which a developer can also force on a user by setting the hl)set to a matching language there is no embed parameter you need to add to force the language. It will match the preference with the available matching language. The only thing you might want to do is force captions on (cc_load_policy=1) if the dialog is one language and your intended audience speaks a different language. Setting hl might be considered rude if the assumption is that most visitors do not have a YouTube cookie that already has their language preference set. It would be interesting to know if YouTube sets language preference (bottom left corner of any YT page) automatically for new user's based either on the browser's language setting or geolocation.

  • Testingvideocf

    Trying to enable captions for mobile w/ a series of parameters with no luck. This is what I currently have: https://www.youtube.com/watch?v=VIDEOURLGOESHERE&hl=en-us&fs=1&fmt=22 (placeholder for video w/ the appended snippet of code) and the other one had this appended to the URL: &hl=en-us&fs=1&fmt=22&cc_load_policy=1
    I also tried ?hl as well
    Any ideas?

  • psambrakos

    Can you force a style for your subtitles in an embedded video? Say, with a transparent background, instead of the default black one.

  • JimmyDee

    your link is wrong in two places.

    If it is going to work with /embed/ you need to change the &hl to ?hl and the CC_load_policy needs to be &cc_load_policy.

    here's a link that works:

    http://www.youtube.com/embed/eWM2joNb9NE?hl=ar&cc_lang_pref=ar&cc_load_policy=1

    To change the link to a normal link, remove the /embed/ and you can use &hl.