• Resolved doozielabs

    (@doozielabs)


    how can I add subtitles/Captions to my video?
    I am using shortcode videojs_video,
    there is no option to add tracks?

Viewing 2 replies - 1 through 2 (of 2 total)
  • I am interested in this feature as well.

    Thread Starter doozielabs

    (@doozielabs)

    I myself managed to add captions,

    You can add to by adding these lines into videojs-html5-player.php file

    global $post;
        $track = get_field("video_caption_url", $post->ID);
        $captions = '';
        if(!empty($track) && $track){
            $captions = "<track class='ld_tracks' kind='captions' src='".$track."' srclang='en' label='English'>";
        }

    now add this caption var to html video player

    <video id="$player" class="video-js vjs-default-skin vjs-big-play-centered"{$controls}{$preload}{$autoplay}{$loop}{$muted}{$poster}{$playsinline} data-setup='{"fluid": true}'>
            $src
            $captions
        </video>
    • This reply was modified 4 years, 2 months ago by doozielabs.
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Captions or subtitles’ is closed to new replies.