-
-
Notifications
You must be signed in to change notification settings - Fork 672
Description
Is your support request related to a problem? Please describe.
I have a single page site (large HTML file with lots of content) which contains a lot of video
elements that range from 1mb-10mb
in size. When the user scrolls quickly past the page to the very bottom, the larger video
take a while to load and are not canceled. Due to this, when the internet connection quality is not very good, the page lags.
To Reproduce
- Create a page with 10+ large-ish video elements.
- Install
lazyload
. - Initialize
LazyLoad
and pass incancel_on_exit: true
option. - Open network debugger/tab.
- Quickly scroll down to the bottom of the page.
- Notice that videos placed at the beginning of the page are still loading and are not canceled.
Expected behavior
The video elements get canceled and stop loading if the user scrolls past them during load.
LazyLoad version
- Version
19.1
Desktop (please complete the following information):
- OS: Windows 10
- Browser: Firefox (Windows), Firefox Focus (iOS)
Additional context
It seems that cancelling only works for img
elements per:
https://github.com/verlok/vanilla-lazyload/blob/master/src/cancelOnExit.js#L12
Is there some reason why its only enabled on img
tags? Is there some workaround I could use to enable canceling for video
elements?