videojs-player icon indicating copy to clipboard operation
videojs-player copied to clipboard

subtitles or captions not working with the player

Open harinisuresh opened this issue 5 years ago • 4 comments

Using the trackList prop does not work.

code: in data():

      trackList: [{
        kind: "Captions",
        label: "caption",
        src: 'https://drive.google.com/uc?export=download&id=162yZ3FgSJCb-MWgyiqgyAPLQUcPBGDbe',
        srcLang: 'English',
        default: true}]

in video element: <video-player ref="trainVidElement" style='width:40%; padding-bottom:40px;' class="center video-player-box vjs-big-play-centered no-outline" :options="trainVidOptions" :trackList="trackList"></video-player>

The subtitles don't appear on the player.

harinisuresh avatar Aug 01 '19 18:08 harinisuresh

Hi Do you have implement this with captions

ameerbjs avatar Jan 22 '20 08:01 ameerbjs

you can set the subtitles and captions in the vue video player like this using video.js

playerReadied: function() { player.addRemoteTextTrack({ src: 'video/0546_prepod_01H.vtt', kind: 'subtitles', srclang: 'ru', label: 'English' }); }

ameerbjs avatar Feb 14 '20 12:02 ameerbjs

请问解决了字幕的问题吗

Acesarye avatar Sep 10 '20 01:09 Acesarye

请问解决了字幕的问题吗

在player readied 的回调中添加 track 即可,字幕文件必须是vtt的 player.addRemoteTextTrack({ src: 'video/0546_prepod_01H.vtt', kind: 'subtitles', srclang: 'ru', label: 'English' });

AndrosEt avatar Jan 04 '21 16:01 AndrosEt