Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Performance issues: Preloading almost 20MB -> A way to lazy load? #474

Open
iadmemoriam opened this issue Mar 15, 2021 · 2 comments
Open

Comments

@iadmemoriam
Copy link

Hello guys! I'm using this plugging and i'm getting like 40 connections to different videoplaback requests.

Do you know about an easy way of lazy load them?

Currently:

  1. showing the carousel with the preview images and a div over it with a big image and a play button
  2. When i click the play button I play the video on full screen

But the problem is that all the videos are being pre-downloaded. Ideally I would love to load them only when i click on their carousel image. Any idea on how to do that? Is there a native way in this lib to avoid predowloading everything?

@luukee
Copy link

luukee commented Jan 23, 2023

Agreed.
https://www.youtube.com/s/player/4248d311/www-widgetapi.vflset/www-widgetapi.js,
https://www.youtube-nocookie.com/s/player/4248d311/player_ias.vflset/en_US/base.js,
and
https://www.youtube.com/iframe_api
are slowing down our pages even though the video's are 60% down the page and only play if a user clicks the play button.

Would be nice to call the video (and all associated scripts) on click or something.

@pupunzi
Copy link
Owner

pupunzi commented Jan 24, 2023

Hi,
you can use an image placeholder in your carusel ad initialize the player only if the image is clicked. This would prevent the preload of all the videos

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants