paulirish / lite-youtube-embed

A faster youtube embed.

Home Page:https://paulirish.github.io/lite-youtube-embed/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

The "Progressive Enhancement" approach does nothing

aarongustafson opened this issue · comments

Maybe instead of a button (which requires JS to work) it should be a direct link to the video?

I think it serves to demonstrate that the script loading can be deferred.

In the demo, <script src="../src/lite-yt-embed.js"></script> is added after 2 seconds. You are still able to show the thumbnail (and button) before loading the script. but clicking on the thumbnail before the script has loaded would not do anything.

IMO this should be the standard usage.

It’s framed as progressive enhancement though, which the example is not. Progressive enhancement requires a minimally functional base state that gets enhanced when certain conditions are met. The button does nothing on its own and would require additional scripting (another dependency) to make it work, therefore is non-functional.

If the example wants to focus on deferred rendering, that’s totally cool, but it should drop the button (which implies interaction) and the “progressive enhancement” label because it is both inaccurate and misleading.