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

145
Visualizações
Video.js bug when skipp video. Progress bar stoping before end

I have a strange bug with Video.Js When I am skipping video with my skip controls I do get such strange bug:

enter image description here

My skip forward looks like this: playerRef.current?.currentTime(playerRef.current?.currentTime() + 10);

REst of my code for player init is based on Video.js docs

 const videoRef = useRef<HTMLVideoElement | null>(null);
  const playerRef = useRef<VideoJsPlayer | null>(null);
  const [pause, setPause] = useState(playerRef.current?.paused() ?? true);

  useEffect(() => {
    // make sure Video.js player is only initialized once
    if (!playerRef.current) {
      const videoElement = videoRef.current;
      if (!videoElement) return;

      const player = (playerRef.current = videojs(videoElement, options, () => {
        /* video.js pause play control */
        player.on('pause', function () {
          setPause(true);
          playerPause && playerPause(true);
        });
        player.on('play', function () {
          setPause(false);
          playerPause && playerPause(false);
          playerLive && player.liveTracker.seekToLiveEdge();
        });
        player.on('ended', function () {
          setPause(true);
          playerPause && playerPause(true);
        });
      }));
    } else {
    }
  }, [options]);

  // Dispose the Video.js player when the functional component unmounts
  useEffect(() => {
    return () => {
      if (playerRef.current) {
        playerRef.current.dispose();
        playerRef.current = null;
      }
    };
  }, []);

I was trying to check how much is remainig and than if it is lower than 10s, skip only remaing time, but still this did not helpe

about 4 years ago · Juan Pablo Isaza
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