How to link youtube video without captions?

妖精的绣舞 提交于 2019-12-03 20:58:05

问题


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?


回答1:


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




回答2:


It seems cc_load_policy is a parameter that only accepts 1 as value, so even if you try to use 0 or off values to turn off captions, it won't make a difference (at least until today: 2015-05-18 2017-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:

  1. Try playing the "No parameters" video and then the 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);
  2. Then play the "nocookie domain" video and there should be no captions.
  3. Try activating captions in the "no parameters" video and refresh the page.
  4. All videos except the "nocookie domain" video will display captions.

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 accept off or Off 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):

  1. In youtube if you go to your video's Info and Settings page and click Advanced Settings tab, set the Video Language to Not applicable.
  2. Save and go to Subtitles and CC page, where a pop-up appears explaining that «You must select a video language before adding subtitles or CC.» (this seems not to be true, because they even appear anyway).
  3. Choose your video's default language in the pop-up: this is what makes it understand that you don't need captions of your default language when the video is in the same default language the 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.
  4. In the URL's video that you do not want to have captions do not use cc_load_policy parameter, but you can use cc_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...




回答3:


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.

When you embed a video on another site, you can make it so that captions are always shown on the embedded video. To enable captions on a video you'd like to embed, just add &cc_load_policy=1 to the video's embed code.




回答4:


It's very simple, add iv_load_policy=3 parameter to your embed code.




回答5:


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 !



来源:https://stackoverflow.com/questions/2287774/how-to-link-youtube-video-without-captions

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!