Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

123
Visualizações
Adding video captions tracks dynamically puts them in the wrong order

When I try and add video text tracks to videoJs player, it adds them in the wrong order where the new track appears above the previous track.

I have created a jsFiddle to show this, can anyone help solve how I fix this?

https://jsfiddle.net/ts9qogdh/3/

enter image description here

  <video id="my_video_1" class="video-js vjs-default-skin" controls preload="auto" width="640" height="268" 
  data-setup='{ }' muted>
    <source src="http://vjs.zencdn.net/v/oceans.mp4" type='video/mp4'>
  </video>
var currPlayer = videojs("my_video_1")

currPlayer.play()
currPlayer.addTextTrack("captions", 'english', 'en');

window.setInterval(() => {
  let currentTime = currPlayer.currentTime();
  const activeCue = new VTTCue(currentTime, currentTime + 2, currentTime + 2)

  var tracks = currPlayer.textTracks();
  let existing = tracks.tracks_.find(x => x.kind === 'captions' && x.language === 'en');

  existing.mode = 'showing';
  existing.addCue(activeCue);
}, 1000)
about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

This CSS should work. Although, in IE11 the captions are a bit spaced-out...

.vjs-text-track-display > div {
    display: flex;
    flex-direction: column;
    justify-content: end;
}

.vjs-text-track-cue {
    position: initial !important;
}

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda