Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

266
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!