Example: Clickable lightweight preview for YouTube with fallback images

View the source of this page for an example of how to implement a lightweight preview image for YouTube videos that is resilient to image load failures. There is no iframe on this page at load time. The iframe is only created when the user clicks the preview.

This example uses the video with ID "bJ7mTY9501c" as an example of a video with a failing image load. To implement yourself, use whatever video ID you want.

YouTube video thumbnail
{/* Play button overlay */}