即使在iOS上也默认显示

即使在iOS上也默认显示

本文介绍了如何强制YouTube字幕(隐藏式字幕)即使在iOS上也默认显示?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我拥有一个YouTube视频,并为此输入了字幕.

I own a YouTube video, and I typed up subtitles for it.

我已经用 yt:cc = on 对其进行了标记,并使用 cc_load_policy = 1& cc = 1 将其iframe嵌入到我的网站中(请参见文档).

I've tagged it with yt:cc=on, and I've embedded its iframe onto my website using cc_load_policy=1&cc=1 (see docs).

当我使用台式机上的Chrome浏览网页时,默认情况下会显示字幕,这是理想的体验.

When I visit my webpage using Chrome on my desktop, the captions appear by default, which is the desired experience.

但是,当我使用iPhone(iOS上的Chrome)访问网页时,默认情况下不会显示字幕.如何使字幕默认显示在iOS上?

(如果我单击语音提示图标,它们将可用,但我不希望用户知道如何执行此操作.)

(They are available if I click the speech bubble icon, but I don't want users to need to know how to do that.)

推荐答案

我发现的唯一方法是更改​​此模式

The only way I found is changing the URI from this pattern

https://www.youtube.com/watch?v= + video_id

此模式

https://www.youtube-nocookie.com/embed/ + video_id + ?hl= lang_code

在bash/Linux上,您可以复制具有该结构的URI,然后运行此命令来转换剪贴板内容(您可以创建别名):

On bash/Linux you can just copy the URI with that structure and then run this command to transform clipboard content (you can make an alias):

xclip -selection c -o | echo "$(cat -)?&hl=es-419" | sed "s|youtube.com/watch?v=|youtube-nocookie.com/embed/|1" | xclip -selection c

在上面的示例中,我对西班牙语代码进行了硬编码.您应该使用该特定视频的可用语言代码之一.您可以使用 ISO 639-1语言代码列出可用的字幕.https://ytdl-org.github.io/youtube-dl/index.html"rel =" nofollow noreferrer> youtube-dl ,在可用字幕部分(赢得不适用于自动字幕):

On the example from above I hardcoded Spanish language code. You should use one of the available language codes for that particular video. You can list the available subtitles ISO 639-1 language codes with youtube-dl, under the section Available subtitles for (won't work for automatic captions):

youtube-dl --list-subs "{video_id or url}"

唯一的缺点是视频将覆盖整个屏幕...对于停止拖拉相关视频可能是一件好事:)

The only drawback is that the video will cover the complete screen... which might be good thing to stop procrastinating with related videos :)

这篇关于如何强制YouTube字幕(隐藏式字幕)即使在iOS上也默认显示?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-18 23:27