I want to change language option ,but it not work,please help me,thank you !
source below:
import videojs$1 from 'video.js';
this.player = videojs$1(this.videoNode,this.props, function onPlayerReady() {});
<video ref={ node => this.videoNode = node } className="video-js vjs-big-play-centered" controls preload="auto" width="640" height="480" data-setup='{"language":"zh-CN"}'>
<p className="vjs-no-js">
No support HTML5锛宲lease upgrade!
</p>
<track kind="captions" />
</video >
videojs.addLanguage is not define ?
馃憢 Thanks for opening your first issue here! 馃憢
If you're reporting a 馃悶 bug, please make sure you include steps to reproduce it. We get a lot of issues on this repo, so please be patient and we will get back to you as soon as we can.
To help make it easier for us to investigate your issue, please follow the contributing guidelines.
yeah , I have encountered the same problem that doesn't work
@liuyuanke I solved it in the following way
const zhCN = require('video.js/dist/lang/zh-CN.json')
videojs.addLanguage('zh-CN',zhCN)
We also compile the json files into js files you can require which automatically call addLanguage. For example https://unpkg.com/[email protected]/dist/lang/zh-CN.js.
const videojs = require('video.js')
require('video.js/dist/lang/zh-CN.js');
We do no include the translations by default because otherwise the file size of Video.js will be unreasonably large.
If importing the language file (in one of the two methods specified above) doesn't work, let us know and we can re-open this issue.
Most helpful comment
@liuyuanke I solved it in the following way
const zhCN = require('video.js/dist/lang/zh-CN.json')videojs.addLanguage('zh-CN',zhCN)