bvaughn / react-virtualized

React components for efficiently rendering large lists and tabular data
http://bvaughn.github.io/react-virtualized/
MIT License
26.31k stars 3.05k forks source link

Measure is not working on mobile with <video> tag #1705

Closed leon-wbr closed 1 month ago

leon-wbr commented 2 years ago

If you're loading a video on mobile using the HTML5 video tag, it will load wrong dimensions at first, so that if you're measuring onLoad, it will not measure correctly. However, on desktop, it works fine as the first render of the video tag is the actual size of the video.

<video
  preload="auto"
  autoPlay
  loop
  muted
  playsinline
  onClick={handleClick}
  onLoadedData={handleLoad}
  isLoading={isLoading}
  ref={videoRef}
>
  <Sources {...{ domain, url, preview, media }} />
</video>

I suppose this has something to do with Chrome mobile behavior, but this should not happen. How can you fix this? Is it related to react-virtualized?