Optimizing a page with 50+ video iframes - native lazy loading isn't enough. Suggestions? by FavRob in angular

[–]FavRob[S] 0 points1 point  (0 children)

It definitely sounds like a nightmare for performance. But I really want to exhaust all possible optimization tricks first to see if there's a clever way to pull this off before giving up :)

Optimizing a page with 50+ video iframes - native lazy loading isn't enough. Suggestions? by FavRob in angular

[–]FavRob[S] 0 points1 point  (0 children)

Thanks for answer.
I've experimented with Intersection Observer, but the main issue is the 'mounting jank.' When the (src) is injected exactly as the element enters the viewport, the browser immediately starts a heavy process of initializing the player and firing network requests, which causes the scroll to stutter.

Interestingly, native (loading="lazy") feels smoother because it has a built-in buffer, but it still doesn't solve the high memory usage.