How To Force Subtitles In An Embedded YouTube Video
It’s been about three years since YouTube introduced improved automatic captions for some of the videos; in a year they became more common and last year they were enabled for all English-language videos.
YouTube captioning is the way to help hearing impaired people to understand the videos and, coupled with automatic translation, it can also help non-English people around the world to access the video content. The feature uses Google speech recognition technology to transcript any uploaded video.
The captions are mostly decent-quality (especially in cases when the speaker in a video talks slowly and clearly). Even in cases when the machine fails to fully understand what is being spoken, you will still be able to understand the content of the video.
By default, captions are disabled in an embedded video, however you may want to force the subtitles for one (or both) of the following reasons:
- You want to make your video more accessible (especially to hearing-impaired people who are unaware of the option).
- You are sharing an English video with non-English-speaking community.
- Even if anyone can enable automatic subtitles manually, few people are actually aware of the option, so showing the captions by default would help a lot.
1. Add Subtitles in an Embedded Video (by Default)
Normally, if a user turned on captions once, YouTube will remember it and play subtitles by default until the user turns them off.
What you can do is to change the default settings (show subtitles to users who don’t have the subtitles disabled or are logged out of Google / Youtube).
To enable subtitles by default, you will need to use &cc_load_policy=1 parameter as shown below:
<object width=”550″ height=”343″><param name=”movie” value=”https://www.youtube.com/v/kTvHIDKLFqc?version=3&hl=en_US&&cc_load_policy=1“></param><param name=”allowFullScreen” value=”true”></param><param name=”allowscriptaccess” value=”always”></param><embed src=”https://www.youtube.com/v/kTvHIDKLFqc?version=3&hl=en_US&rel=0&cc_load_policy=1” type=”application/x-shockwave-flash” width=”550″ height=”343″ allowscriptaccess=”always” allowfullscreen=”true”></embed></object>
Iframe (mobile-friendly) code:
<iframe width=”550″ height=”343″ src=”https://www.youtube.com/embed/kTvHIDKLFqc?rel=0&cc_load_policy=1” frameborder=”0″ allowfullscreen></iframe>
2. Translate Subtitles in an Embedded Code
Despite the fact that this parameter is not “officially” described, YouTube has supported it for ages: “hl=” parameter in an embed code pre-selects the subtitle language. Most of these language code should work when used after the &hl= parameter: Language Codes
This means that the following code should work to play the video automatically with translated subtitles:
<object width=”550″ height=”343″>
<param name=”movie” value=”https://www.youtube.com/v/kTvHIDKLFqc?version=3&fs=1&hl=ru&cc_load_policy=1&rel=0&hd=1″>
<param name=”allowFullScreen” value=”true”>
<param name=”allowscriptaccess” value=”always”>
<embed src=”https://www.youtube.com/v/kTvHIDKLFqc?version=3&fs=1&hl=ru&cc_load_policy=1&rel=0&hd=1″ type=”application/x-shockwave-flash” width=”550″ height=”343″ allowscriptaccess=”always” allowfullscreen=”true”></embed>
However, due to reported bugs, this code won’t work in many cases (maybe because of the numerous tweaks to the YouTube player). If you start experimenting with automatically translated captions, check out this particular post offering a few workarounds to the bug (one possible workaround is to use version=3 parameter in an embedded code).
Also, there is no way to translate captions in an iframe-based (newer) version of the embed player (sadly).
3. Linking to Videos with Captions
If you want to share a link to the video for viewers to see captions by default, you need to add this code at the end of the URL string:
More tricks to know about YouTube video URLs and embed player:
- 10 Youtube URL Tricks You Should Know About
- 10 More Cool Things You Can Do With YouTube Videos
- 4 Ways To Easily Embed Part Of A YouTube Video
What are your experience with YouTube subtitles? Have you ever found them useful? Please share your thoughts!