如何链接没有字幕的 YouTube 视频?
是否可以在 HTML 代码中链接 youtube 视频而不显示其字幕(字幕)?
我找到了此链接,其中包含说明去做,但似乎不起作用。如果我尝试使用以下格式的链接,它仍然会显示标题: http:// www.youtube.com/watch?v=kTvHIDKLFqc&cc_load_policy=0。是它不起作用还是我误解了什么?
Is it possible to link youtube videos in HTML code without showing it's captions (subtitles)?
Let's say I have following video: http://www.youtube.com/watch?v=kTvHIDKLFqc . It has default english subtitles. However, when linking this video, I want to load it without them. Is there a possibility to do so with some kind of parameter in video?
I found this link with description how to do it, but it doesn't seem to work. If I try to use following format of link, it shows captions anyway: http://www.youtube.com/watch?v=kTvHIDKLFqc&cc_load_policy=0. Is it not working or did I misunderstand anything?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
我发现文档有点误导,因为设置 &cc_load_policy=1 默认情况下不显示隐藏式字幕,但在输入时可以使用视频控制栏中的 cc 按钮进行切换,如下所示 -
http://www.google.com/support/youtube/bin/answer .py?hl=zh-CN&answer=140174
I found the documentation to be a little misleading in that setting &cc_load_policy=1 does not show the closed captions by default, but enables toggling with the cc button in the video control bar when entered as shown here -
http://www.google.com/support/youtube/bin/answer.py?hl=en&answer=140174
看来
cc_load_policy
是一个只接受1
作为值的参数,所以即使您尝试使用0
或off
> 值来关闭字幕,这不会产生任何影响(至少直到今天:2015-05-182017-09-11):https://developers.google.com/youtube/player_parameters#cc_load_policy
2017-09 -11 解决方案:“启用隐私增强模式”
当您通过嵌入选项在 Youtube 中分享视频时,可以单击“启用隐私增强模式”复选框。这会将 URL 更改为不同的 Youtube 域:
https://www.youtube-nocookie.com
只要这样做,即使用户有字幕默认情况下,nocookie 选项将不会读取与用户首选项关联的 cookie(就好像用户默认情况下不需要字幕一样)。
我创建了这个 codepen 示例来解释这一点:
cc_load_policy=1
视频(由于用户偏好,它可能不会显示字幕,即使后者激活了 CC 按钮 - 红色下划线);免责声明:我只在 Chrome 中看到过这种情况(Firefox 和 Edge 总是在 nocookie 域中显示标题,即使在私人导航中也是如此)。如果您在“nocookie 域”视频中手动激活/停用字幕,则当您分别刷新页面时,它将显示/隐藏该域中的字幕。
老东西(视频所有者的部分解决方案)
cc_lang_pref
也不接受off
或Off
作为值...我设法将以这种方式关闭视频默认语言的字幕/字幕仅适用于 Safari 和 IE(我有默认语言和英语的字幕 - 就我而言,Chrome 和 Firefox 似乎忽略了更改,但我建议还是尝试一下):
不适用
。这样,当视频采用相同的默认语言时,它就会明白您不需要默认语言的字幕奇怪的是,这一步会让他们不出现,而这并不是因为字幕中使用了相同的语言。cc_load_policy
参数,但您可以使用cc_lang_pref
作为默认语言,如下所示:http://www.youtube.com/watch?v=kTvHIDKLFqc&cc_lang_pref= zh-cn。
同样,这似乎仅在某些浏览器中有效(不包括 Firefox 和 Chrome),但希望它能有所帮助......
It seems
cc_load_policy
is a parameter that only accepts1
as value, so even if you try to use0
oroff
values to turn off captions, it won't make a difference (at least until today:2015-05-182017-09-11):https://developers.google.com/youtube/player_parameters#cc_load_policy
2017-09-11 Solution: "Enable privacy-enhanced mode"
When you share a video in Youtube through the embedding option, you can click the "Enable privacy-enhanced mode" checkbox. This will change the URL to a different Youtube domain:
https://www.youtube-nocookie.com
Just by doing this, even if the user has captions On by default, the nocookie option will not read the cookie associated to the user preferences (it's as if the user does not require captions by default).
I have created this codepen example in order to explain this:
cc_load_policy=1
video (it may not display captions due to user preferences, even if in the latter the CC button is activated - red underline);Disclaimer: I have only seen this working in Chrome (Firefox and Edge always display captions in the nocookie domain, even in private navigations). If you activate/deactivate captions manually in the "nocookie domain" video, then it will display/hide captions in this domain when you refresh the page respectively.
Old stuff (partial solution for owners of the video)
cc_lang_pref
does not acceptoff
orOff
as a value either...I managed to turn off captions/subtitles for the default language of the video this way only for Safari and IE (I have captions in the default language and English - in my case, Chrome and Firefox seemed to have ignored the change, but I suggest to give it a shot anyway):
Not applicable
.this is what makes it understand that you don't need captions of your default language when the video is in the same default languagethe weird thing is, this is the step that will make them not to show up, and it's not because the same language is used in the captions.cc_load_policy
parameter, but you can usecc_lang_pref
to the default language like this:http://www.youtube.com/watch?v=kTvHIDKLFqc&cc_lang_pref=en.
Again, this seems to work only in some browsers (Firefox and Chrome not included), but hope it helps...
该网站说明了如何打开字幕。它没有谈论关闭字幕。我认为这取决于用户之前的选择。
The site says how to turn on caption. It does not talk about turning off captions. I thinkit depends on the user's previous choice.
愿遵循指导的人平安,
(感谢您的尝试,但我在离那里不远的地方发现了一些不错的东西......)
要求不是来自翻译字幕的语言偏好(对于我的例子“他”代表希伯来语,即不在视频提供的翻译范围内。)
将 ?hl=He 添加到 URL,如下所示:
没有它:
https://www.youtube.com/watch?v=pRztmbnyV70
及其:
https://www.youtube.com/watch?v=pRztmbnyV70?hl=他
做到了...?
它在 Firefox、Edge 和 Opera 上对我有用。
- 享受 !
注意:页面加载后粒子消失......但是工作已经完成!
Peace to whom will follow the guidance,
(Thanks for your tries but I found something nice not far away from there...)
Ask for a language preference that is not from the translated captions (for my exemple "He" stands Hebrew, that was not among the offered translations of the video.)
Add ?hl=He to the url, like this :
without it :
https://www.youtube.com/watch?v=pRztmbnyV70
and with it :
https://www.youtube.com/watch?v=pRztmbnyV70?hl=He
Makes it... ?
It worked for me on Firefox, Edge and Opera.
-- Enjoy !
Note : the particle desapears after the loading of the page ...But the job is done !
非常简单,只需将
iv_load_policy=3
参数添加到您的嵌入代码中即可。It's very simple, add
iv_load_policy=3
parameter to your embed code.