Embed Youtube with Captions on by default not working

一笑奈何 提交于 2019-12-07 10:45:05

问题


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>

回答1:


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



来源:https://stackoverflow.com/questions/41239654/embed-youtube-with-captions-on-by-default-not-working

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!