youtube embed - force subtitles in specific language with default

前端 未结 4 1868
执笔经年
执笔经年 2020-12-09 05:38

i\'m embedding youtube videos with subtitles in specific language (Hebrew, in my case). im using:

hl=He&cc_load_policy=1

to show the

4条回答
  •  醉梦人生
    2020-12-09 06:11

    You can force the captions and language using cc_load_policy & cc_lang_pref options via

    URL:

    http://www.youtube.com/embed/M7lc1UVf-VE?cc_load_policy=1&cc_lang_pref=en

    API:

    var ytPlayer = new YT.Player(
        ...
        playerVars: {
            cc_load_policy: 1,
            cc_lang_pref: 'en'
        },
        ....
    });
    

    Credits: https://webapps.stackexchange.com/questions/27669/is-there-any-way-to-force-subtitles-in-a-youtube-video

提交回复
热议问题