Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

327
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda