Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[twisty] Use
IntersectionObserver
to avoid rendering players until …
…they're on the screen. Since we set `contain: size` on the `.wrapper` inside the player, this should not affect page layout. Since the `TwistyProp` hierarchy can be initialized and updated independent of the DOM, this means that you can even call `.play()` on a player before it starts rendering, and the rendering will smoothly pick up fromq the middle of the animation as soon as the player enters the viewport. (Note that there is no way to enforce any of this, though, and it is entirely possible for future code to make bad assumptions that breaks this. A browser test would be very useful for this.)
- Loading branch information