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

118
Visualizações
React slider with audio ontimeupdate

In the event ontimeupdate I pass the value of currentTime to the Slider and it works correctly, the bar advances and covers the range of audio duration.

But the problem is that it is not a fluid movement, it makes little jumps. I have the step property of the Slider set to 0.01 but it seems to be detected only when dragging, but not automatic movement.

In Angular I have a similar application with mat-slider and I do not have this problem that arises in React.

audioEl.current.ontimeupdate = () =>{
   setCurrentTime(audioEl.current.currentTime)                
   setSliderValue(audioEl.current.currentTime);   
} 

const handleChange = (event, newValue) => {
    setSliderValue(newValue);
    setCurrentTime(newValue)
    audioEl.current.currentTime = newValue;
};

<Slider aria-label="Current time" step={0.01} value={sliderValue} onChange={handleChange} min={0} max={duration}/>

Thanks! :)

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