Public
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Embedding YouTube with different languages

Hi guys, I'm running a few different versions of a single blog in different languages. To begin with, much of the content is the same across the different languages and has been professionally translated by copy teams. However, I have a few videos to include, the ones that aren't available in the other languages have just been left out for now but YouTube has an option both to translate the captions and while it is a bit of a poor substitute, it should be included.

 

Where I'm tripping up the though is getting the video to embed with the captions both turned on and translated, at the minute I can't get it to do either and I was hoping someone else would have come across the same issue.

 

Googling around says you should include '&cc_load_policy=1' at the end of the embed code to turn captions on and then 'cc_lang_pref=fr' (for French) before this to choose the language preferences.

 

I got it to change the language of the menu items etc. to change to French but the default option for subtitles was still 'anglais' and they were not on by default.

 

Anyone have any experience with this that they could help me out?

 

Thanks,

3 Replies 3

Hey,

 

Does this help:

 

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:

 

hl=es&cc_lang_pref=escc_load_policy=1

 

Looks like your just missing the "hl" variable on the URL. 

 

Hope this helps.

 

 

 

Stephen

Checkout some of the stuff i've built using the platform:
Community l Ideation l Blog l Product Hubs l Check & Report l Service Status 

My latest Ideas: Vanity URL Manager l @mention Roles l  LSW Password Policy

Hi mate, thanks for your reply. Unfortunately that hasn't seemed to work either.

 

I've been practising with this video: https://www.youtube.com/watch?v=HGUjqtopjvs which if you click into it etc. does have foreign language captions available yet I can't get it to embed and play them automatically, even just in a HTML txt file let alone Lithium.

 

Do you think it's to do with youtube's new embed code?

Lithium Alumni (Retired)

Hi @domladden 

 

have you had a look at the Youtube Embedded Player Documentation ? It seems the hl parameter is only supported for the HTML5 and AS3 players. This may also help:

Make captions automatically appear for an embedded video by adding "&cc_load_policy=1" to the video's embed code.
You can also choose a caption language for the embedded video. To specify the caption language for the video that you'd like to embed, just add "&cc_lang_pref=fr&cc_load_policy=1" to the video's embed code.

"cc_lang_pref" sets the language for the captions shown in the video.
"cc_load_policy=1" turns captions on by default.
"fr" represents the language code for French. You can look up 2-letter language codes in the ISO 639-1 standard.

 

Hope it helps


Paolo Tagliaferri
Principal Technical Consultant

Lithium

Welcome to the Technology board!

Curious about our platform? Looking to connect on social technology? You've come to the right place!

Are you a Khoros customer? For direct assistance from our Support team, please visit the Support Forum.