默认情况下,嵌入带字幕的Youtube无法正常工作 [英] Embed Youtube with Captions on by default not working

查看:186
本文介绍了默认情况下,嵌入带字幕的Youtube无法正常工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试嵌入Youtube电影,并且希望默认情况下启用字幕。

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

来自 https:// developers。 google.com/youtube/player_parameters#cc_load_policy 我知道我应该使用 cc_load_policy = 1

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

我使用以下代码html代码,但似乎无法正常工作。也就是说,它会关闭字幕(您可以手动打开字幕,因此视频中确实有字幕)。我在做什么错了?

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>


推荐答案

尝试添加cc_lang_pref,您不会在官方文档。但这是必需的

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

这篇关于默认情况下,嵌入带字幕的Youtube无法正常工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆