paulirish / lite-youtube-embed

A faster youtube embed.
https://paulirish.github.io/lite-youtube-embed/
Other
5.68k stars 260 forks source link

The "Progressive Enhancement" approach does nothing #113

Closed aarongustafson closed 2 years ago

aarongustafson commented 2 years ago

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

kevinfarrugia commented 2 years ago

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.

aarongustafson commented 2 years ago

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.