## Ticket
5457 Create file thumbnail fallback image for odysee
## Approach
Since `background-image` does not invoke an `onerror` event, create a test Image instance to have the `onerror` capability. This technique is used by majority of plugins. No additional fetch is seen with this technique.
## Issue
#6332 <Thumbnail lazy-loader is too slow || Use browser-level lazy-loading>
## Change
Switch from "threshold-based check" to "viewport distance comparison" using the `rootMargin` parameter. The root is the viewport.
This change makes it closer to the native `loading="lazy"` behavior, where it starts to load when approaching the viewport. Chrome I believe uses 3000px distance -- I think 500px is a good compromise for now. Can adjust further.
## Future
- We are currently creating N instances of IntersectionObserver.
- https://developers.google.com/web/updates/2016/04/intersectionobserver
- "If you need to observe multiple elements, it is both possible and advised to observe multiple elements using the same IntersectionObserver instance by calling observe() multiple times."
This would probably need a refactor to make ClaimList (or something higher) own the IntersectionObserver.
## Issue
6010: hyperchat send display issues with GIF profiles
The FreezeFrameWrapper have no `src` to freeze due to the lazy loading.
## Fix
Delay the freezing by making the lazy-load effect return a state to indicate when then `src` has been loaded.
Since the lazy-loader will `unobserve` after loading, the state will never go back to false, so we don't need to handle the case of preventing `new FreezeFrameWrapper` from being called multiple times from it's effect.