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

267
Visualizações
Call load() from react-howler

I want to call load() with set timeout ,how add to my code

It offer from library

Docs:

load()

When preload is true this is automatically called. When setting preload to false, you can call load() manually before playing sounds (useful for lazy loading large files on slow networks). If you attempt to play a sound that's not loading or loaded with preload react-howler will automatically call load().

And there is my code

  <ReactHowler
          src={Audio}
          preload={false}
          playing={isplaying ? false : true}
        />
about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

For a fully controlled example (in a class-based component) take a look at the official examples

The trick is to get a ref to the howler component, then you can call load on it. So the following should work:

const howlerRef = useRef(null);

const myLoadFunc = ()=>{
  if(howlerRef.current) {
    howlerRef.current.load();
  }
}

return (
  <>
    <ReactHowler
          src={Audio}
          preload={false}
          playing={isplaying ? false : true}
          ref={howlerRef}
        />
    <button onClick={myLoadFunc}>start loading</button>
  </>
)
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