Forum Discussion
Parameters for embedded YouTube video
I embedded a YouTube video and added parameters as mentioned in this article. This is what I put <iframe width="560" height="315" src="https://www.youtube.com/embed/Code?autoplay=1&cc_lang_pref=es&cc_load_policy=1" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; allow='autoplay'; picture-in-picture" allowfullscreen=""></iframe>.
My goal is to have the video play with cc in Spanish. When I publish, the video displays and autoplays, but it does not show cc or set the default cc language to Spanish. Can anyone help?
Hi Brandon,
Thanks for reaching out!
I took a look at the video and saw that Spanish isn't an available subtitle language for the video.
Try choosing a video with Spanish subtitles available and let me know if this works for you!
- BrandonKrogelCommunity Member
Thanks. I will find one. Is there a script to run the auto-translate in Spanish or do you have to have Spanish subtitles?
- LuisNogueraCommunity Member
Hi Jose,
I work with Brandon. Here is the link for the video in Spanish (Mexico and Latin America, English and French). Could you please try with that one?
https://youtu.be/n25VzikHK0M - SamHillSuper Hero
Hi there.
It may be that you are not using the correct language code, as the available subtitles are Spanish (Latin America) es-419 and Spanish (Mexico) es-MX. Try using those codes in your embed. I think the es code is reserved for Spanish.
Thanks,
Sam - SamHillSuper Hero
For example, this embed code will load with Spanish (Mexico)
<iframe width="1280" height="720" src="https://www.youtube.com/embed/n25VzikHK0M?autoplay=1&cc_lang_pref=es-MX&cc_load_policy=1" title="HECP 1A Intro to Hazardous Energy Sources Fina" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen></iframe> - LuisNogueraCommunity Member
Thank you, Sam, I was using ISO-639.1 or .2
I appreciate your help. It is working now!!!