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

91
Views
<video> tag rendering is delayed on mobile, resulting in wrong dimensions measured (React)

I'm trying to measure a dynamic height for use in a virtualized list (react-virtualized). So on loading the image, I do the following:

const handleLoad = () => setLoading(false);

  useLayoutEffect(() => {
    if (isLoading) return;
    if (measure) measure();
  }, [isLoading]);

Triggered by the video tag:

<StyledVideo
          autoPlay
          loop
          muted
          playsinline
          onClick={handleClick}
          onLoadedMetadata={handleLoad}
          isLoading={isLoading}
          ref={videoRef}
        >
          <Sources {...{ domain, url, preview, media }} />
        </StyledVideo>

It works perfectly fine on desktop, but on mobile it is delayed (you can even see it loading, then adjust the height). How do I make it measure properly even on mobile?

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!