The linked blog post describes three URL components that you can use in YouTube video links to control subtitles (ie. language), HD and fullscreen playback. I only tested the subtitle language selector
hl
parameter and unfortunately it does not really work (it works only if you've turned on subtitles previously on some YT video). The
hl
parameter selects the UI language (if available), which also sets the default CC (closed captions, aka. subtitles) language in case the given video has a CC in the specified language. However the
hl
parameter does not turn on the display of subtitles automatically (ie. regardless of the user's previous settings)! There's a method to do that, but not yet as an URL parameter.
As described in
this YouTube Help post, you can enable/force captions via an embed parameter. For that you've to have full control over the embed code of the given YouTube video. In case you don't want to post the given video on your blog (or any website you own), you can use a free HTML publishing service like
pastehtml.com.
Let's see an example. I've loaded a YouTube video (
"The Story of Bottled Water") which has been subtitled in Hungarian. I've right-clicked the video and selected "Copy embed html" which copied the video's embed code to the clipboard. Now I've pasted this code into pastehtml.com's textarea and added the
cc_load_policy=1
parameter to the end of the YouTube video URL in the embed code.
It became this (I've formatted the embed code for better readability):
<object style="height: 390px; width: 640px">
<param name="movie" value="http://www.youtube.com/v/V8UiuC0i6vs?version=3&cc_load_policy=1">
<param name="allowFullScreen" value="true">
<param name="allowScriptAccess" value="always">
<embed src="http://www.youtube.com/v/V8UiuC0i6vs?version=3&cc_load_policy=1" type="application/x-shockwave-flash" allowfullscreen="true" allowScriptAccess="always" width="640" height="390">
</object>
You can watch the result
here. The embedded video automatically displays the hungarian closed captions. There's one further step: we did not specify the CC/subtitle language. Using the
hl=hu
parameter as well we can force the use of Hungarian subs (in case the given video has subtitles in more languages).
That will leave us with the following embed code:
<object style="height: 390px; width: 640px">
<param name="movie" value="http://www.youtube.com/v/V8UiuC0i6vs?version=3&cc_load_policy=1&hl=hu">
<param name="allowFullScreen" value="true">
<param name="allowScriptAccess" value="always">
<embed src="http://www.youtube.com/v/V8UiuC0i6vs?version=3&cc_load_policy=1&hl=hu" type="application/x-shockwave-flash" allowfullscreen="true" allowScriptAccess="always" width="640" height="390">
</object>
Comments
Thanks
Thanks!
http://www.youtube.com/watch?v={video_id}&hl=en&cc_load_policy=1
Re: Thanks!
http://www.youtube.com/watch?v=V8UiuC0i6vs&hl=hu&cc_load_policy=1
and it didn't turn on captions for me. It still works as I described before: the URLcc_load_policy
is only effective if you've enabled captions before (manually). Try testing it with a brand new Firefox profile (i.e. no cookies, cache or history of any YouTube activity).