• Resolved wordzebra

    (@wordzebra)


    Hi,

    I’m trying to add subtitles to embedded YouTube video, but I’m not sure where to put the extra string.

    I’m pasting the website URL here, since I’m a little bit annoyed that a google search with the site name refers to this forum: https://just-paste.it/kCyCISgP28

    Here’s my code and what I did:

    embedded video code:

    <figure class=”wp-block-embed aligncenter is-type-video is-provider-youtube wp-block-embed-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio”><div class=”wp-block-embed__wrapper”>

    </div></figure>

    instructions from Google:

    Make captions automatically appear for an embedded video by adding “&cc_load_policy=1” to the video’s embed code.

    You can also choose a caption language for the embedded video. To specify the caption language for the video that you’d like to embed, just add “&cc_lang_pref=fr&cc_load_policy=1” to the video’s embed code.

    “cc_lang_pref” sets the language for the captions shown in the video.
    “cc_load_policy=1” turns captions on by default.
    “fr” represents the language code for French. You can look up 2-letter language codes in the ISO 639-1 standard.

    so I added “&cc_lang_pref=bg&cc_load_policy=1″ by glueing it directly to the video URL, but that doesn’t work, where should I put it?

    <figure class=”wp-block-embed aligncenter is-type-video is-provider-youtube wp-block-embed-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio”><div class=”wp-block-embed__wrapper”>

    </div></figure>

    That breaks the video.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter wordzebra

    (@wordzebra)

    I see that this page implements the code in what I wrote and puts the video on the screen, rather than show the code (funny!)

    So clear code here:

    https://paste.opensuse.org/5262455

    Hi @wordzebra!

    Unfortunately this isn’t a theme related issue, subtitles can’t be added on embedded Youtube videos through the theme.

    Thank you and have a nice day!

    Hello,
    Not sure if I’m allowed to try to help, but this worked:

    https://www.youtube.com/embed/4Z9WVZddH9w?cc_lang_pref=bg&cc_load_policy=1

    creigmalta

    (@creigmalta)

    Make captions automatically appear for an embedded video by adding “&cc_load_policy=1” to the video’s embed code.

    You can also choose a caption language for the embedded youtube video. To specify the caption language for the video that you’d like to embed, just add “&cc_lang_pref=fr&cc_load_policy=1” to the video’s embed code.

    “cc_lang_pref” sets the language for the captions shown in the video.
    “cc_load_policy=1” turns captions on by default.
    “fr” represents the language code for French. You can look up 2-letter language codes in the ISO 639-1 standard.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Add subtitles to embedded video’ is closed to new replies.