Subtitles Automatic Translations

GOLD
This is an experimental feature offered by the Nuevo plugin. Single subtitles loaded through the loadTracks Nuevo function can be automatically translated to multiple languages using the Google translation service. You can choose several languages from over 150 languages available!
For the video above, we have prepared single English subtitles. When the video is loaded, subtitles are automatically translated to five (5) next languages and appear to choose in the subtitles menu.
Code snippet
<video id="my_player" class="video-js vjs fluid" controls preload="auto" plysinline>
<source srv="m3u8-manifesr-url" type="application/x-mpegURL">
</video>

<script src="/videojs/player.min.js"></script>
<script src="/videojs/nuevo.min.js"></script>
<script src="/videojs/plugins/translate.js"></script>

<script>
const player = videojs("my_player");
player.nuevo();

player.on('loadeddata', function(){
this.loadTracks(
{kind:"captions", src:"captions_en.vtt-url", srclang:"en", label:"English", default:"1"},
['de','es','it','fr','ja']
);
});
</script>
As you can see, there is a second parameter in the loadTracks function. The first parameter refers to a single text track defined above. This first track will be translated into the following languages. The second parameter is an array of language codes that you want to translate. That's easy!
You can choose from a list of over 150 languages that you wish to translate. Each language has its own code that you can include in an array as the second function's parameter. Have a look at the full list of supported languages and their codes.

Language names (labels) that appear in the subtitles menu are in English by default. However, you can display them in any other language by setting the language code as the loadTracks function's third parameter.
Code snippet

player.on('loadeddata', function(){
this.loadTracks(
{kind:"captions", src:"captions_en.vtt-url", srclang:"en", label:"English", default:"1"},
['de','es','it','fr','ja'],
'es'
);
}|);
The third parameter, 'es' is a language code that indicates the language in which the labels will be displayed in the subtitles menu..

Finally, there is also an option to display labels in the subtitles menu, each in its native language. Enough is to set the third parameter to "default".
Code snippet

player.on('loadeddata', function(){
this.loadTracks(
{kind:"captions", src:"captions_en.vtt-url", srclang:"en", label:"English", default:"1"},
['de','es','it','fr','ja'],
'default'
);
}|);