Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

325
Views
I changed the vtt subtitle file using javascript in videojs, but the content is not reflected
        if (__evt__.player.options_.tracks[0] != null) {
        //__evt__.player.options_.tracks[0] = {src: vttsrc,kind:'subtitles' ,srclang:'ko',label:'korean'};
        //__evt__.player.options_.tracks.splice(0,1,{src: vttsrc,kind:'subtitles' ,srclang:'ko',label:'korean'})
        console.log(__evt__.player.textTracks_.tracks_);
        __evt__.player.textTracks_.tracks_[0].src = vttsrc;
        __evt__.player.textTracks_.tracks_[0].label = "02";
        __evt__.player.options_.tracks[0].src = vttsrc;
        __evt__.player.options_.tracks[0].label = "02";
        //__evt__.player.textTracks_.tracks_[0] = {src: vttsrc,kind:'subtitles' ,srclang:'ko',label:'korean'};
        console.log(__evt__.player.textTracks_.tracks_);

    } else {
        __evt__.player.options_.tracks.push({src: vttsrc,kind:'subtitles' ,srclang:'ko',label:'korean'});
    }

The above source code pushes the subtitles for the first video, and after that, the track information is modified and reflected in javascript at the [0]th.

The normal operation of the first subtitle has been confirmed. When the second video was played, it was also confirmed that the label was changed normally.

However, there is a problem that the subtitles of the second video are not output normally, and the first subtitles are output.

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Rather than modifying options after player init, use removeRemoteTextTrack() and addRemoteTextTrack() to replace the tracks.

https://docs.videojs.com/tutorial-text-tracks.html#remote-text-tracks

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!