videojs-player
videojs-player copied to clipboard
subtitles or captions not working with the player
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.
Hi Do you have implement this with captions
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' }); }
请问解决了字幕的问题吗
请问解决了字幕的问题吗
在player readied 的回调中添加 track 即可,字幕文件必须是vtt的 player.addRemoteTextTrack({ src: 'video/0546_prepod_01H.vtt', kind: 'subtitles', srclang: 'ru', label: 'English' });