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

167
Views
React Video Player onTimeUpdate execute function when video watched some percentage?

I am trying to make some trigger when video watched %60 some function would execute.

Assign onTimeUpdate attribute on video tag.<video onTimeUpdate={ onPlaying }/>

const [currTime, setCurrTime] = useState(0);

const onPlaying = () => {
    setCurrTime(videoRef.current.currentTime);
    console.log(Math.round(currTime));
  };

  useEffect(() => {
    if (Math.round(currTime) > 5) {
      console.log('Trigger');
    }
  }, []);

When I pass the currTime as secondParameter it works but trigger every update. I want to trigger only once when video reached some defined value.

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