How to optimize iframe load time?

1

I have a page with several YouTube iframes that are taking a long time to load.

I would like to know if it is possible to decrease this loading time or if it is not possible, like putting an animation until all the videos are loaded.

    
asked by anonymous 02.12.2016 / 19:49

1 answer

4

Yes, it would be possible to decrease the loading time of the page, you should only load what is visible on the screen, the others would leave it for later. See if the Lazy load XT plugin at this link helps you:

link

About the animation, it is very simple and quick to do, just put an image as your inbox background through CSS.

link

CSS

iframe.loading {
  /* imagem from search on google :p */
  background: url(https://www.aiag.org/Content/images/admin_throbber.gif) no-repeat center center;
}

HTML

<iframe class='loading' src='https://www.youtube.com/embed/Zi_XLOBDo_Y' />
    
02.12.2016 / 22:41