Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Embed Youtube with Captions on by default not working

I'm trying to embed a Youtube movie, and would like Captions to be on by default.

From https://developers.google.com/youtube/player_parameters#cc_load_policy I understand I should use cc_load_policy=1.

I use the code html code below but it doesn't seem to work. That is, it loads with the captions off (you can manually turn captions on, so the video does have captions). What am I doing wrong?

I've tried the following two options:

<iframe src="https://www.youtube-nocookie.com/embed/xxxxxx?rel=0&amp;&showinfo=0&cc_load_policy=1" frameborder="0" allowfullscreen></iframe>
<iframe src="https://www.youtube-nocookie.com/embed/xxxxxx?rel=0&amp;&showinfo=0" cc_load_policy="1" frameborder="0" allowfullscreen></iframe>
like image 225
Marty Avatar asked Mar 10 '23 08:03

Marty


1 Answers

Try adding cc_lang_pref , you wouldn't find in the official docs. but it's required

cc_load_policy=1&cc_lang_pref=en

You can change pref. language as per the locale representation of the language you have put in the video caption

like image 59
Vinay Avatar answered Mar 21 '23 09:03

Vinay