Paratii-Video / paratii-player

Probably the world's 1st in-player token wallet (v0.0.1 of the Paratii embeddable web player).
http://paratii.video
GNU General Public License v3.0
41 stars 11 forks source link

Frontend - Loader component / Lazy load images #302

Closed jrgarou closed 6 years ago

jrgarou commented 6 years ago

Main loader

Based on @pedrocasa reference.

The {{> mainLoader}} it's already in the body. The .main-app receive the show-main-loader class from showMainLoaderClass helper when Session.get('showMainLoader', true)

jrgarou commented 6 years ago

Lazy load thumbs images

image

To avoid the situation above I've installed the bLazy to show image only when it's loaded. More about it: https://github.com/dinbror/blazy/

Create a new instance: https://github.com/Paratii-Video/paratii-player/blob/3bf7d431ac0eca449fb8d29f860d87c4e9442dd7/imports/ui/pages/playlists/playlists.js#L21-L25

... then revalidate when is need it https://github.com/Paratii-Video/paratii-player/blob/3bf7d431ac0eca449fb8d29f860d87c4e9442dd7/imports/ui/pages/playlists/playlists.js#L50

jellegerbrandy commented 6 years ago

what does that "blazy" resolve exactly? (I'm asking because we have very long load times, and so I am bt wary of installing yet another new library)

jrgarou commented 6 years ago

@jellegerbrandy In my local, images are taking time to load. In playlist page (e.g. /playlists/2) all thumb images are load, not just the visible images in pagination. So the firsts images could take too long time to load, and keep loading when page is changed.

image

For that I decided to use the bLazy, to control this load and how images are displayed (I didn't setup to load in pagination in the commit). But the slow loading is only in my local. On the staging the image loading is pretty good.