Explore the community Forums Lectora Lectora Questions & Answers Multiple Language Captions Reply To: Multiple Language Captions

#445031 Score: 0
Profile photo of Math Notermans
Math Notermans
Member
contributor
intermediate
advanced
friend finder
junior moderator
advocate
LUC16 Attendee
LUC16
wise owl
curious george
129 pts
@mnotermans5114

Quickly jumped on it and it should be possible to use multilanguage VTT files in the default player. In the Lectora code i found several pieces of code that point to that.

if (lang == ‘none’) {
t.selectedTrack = null;
t.captionsButton.removeClass(‘mejs-captions-enabled’);
} else {
for (i=0; i<t.tracks.length; i++) {
if (t.tracks[i].srclang == lang) {
if (t.selectedTrack === null)
t.captionsButton.addClass(‘mejs-captions-enabled’);
t.selectedTrack = t.tracks[i];
t.captions.attr(‘lang’, t.selectedTrack.srclang);
t.displayCaptions();
break;
}
}
}

 

Above a piece of code from the Trivantis scripts that show a if/else about a variable ‘lang’.
That suggest that if you somehow can set that variable to EN or ES or whatever language you want,
and do have multiple VTT or SRT files in your project…it will make it multilanguage.

 

Further more i found a AJAX call for a source file for the VTT…

$.ajax({
url: track.src

That one you can use to to change the source of the VTT and/or movie file.

As said, if you deliver me a sample of one of your courses ( or just the part with the video ) i get it working.

Kind regards,

Math