How To Add Image Overlay To Embedded YouTube Videos

<div onclick="thevid=document.getElementById('thevideo'); thevid.style.display='block'; this.style.display='none'"><img src="vidthumb.jpg" style="cursor:pointer" /></div><div id="thevideo" style="display:none">

(put the YouTube embed stuff here)

</div>
Advertisements

3 thoughts on “How To Add Image Overlay To Embedded YouTube Videos

    • Thanks very much!

      I added an “&autoplay=1” to the video so it plays the video when you click the image.

      This was very helpful!

  1. Derekrreynolds,

    How can I used a Facebook Like Button or Share button instead of Image ?

    Thanks for this great peace of code.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s