/youtube-loader

Significantly optimise video heavy page loading times by dynamically swapping out YouTube iframes with images and loading iframes only when clicked.

Primary LanguageJavaScript

youtube loader

Significantly optimise video heavy page loading times by dynamically swapping out YouTube iframes with placeholder images, subsequently loading video iframes only when clicked.

Usage:

Requires jQuery. Include youtube-loader.js after jQuery in the footer of your html. Any YouTube iframes in the HTML will be replaced with placeholder images & a play button overlay. Clicking the play button will then dynamically substitute in the YouTube iframe and play the video as normal.

Project Page

Demo here