1

I would like to place a static image on top of the YouTube Video Player; however, it appears as if they somehow block this from occurring?

So far I have tried setting the z-index higher than the YouTube player but this does not work.

For example:

<img src="../example.png"/ width="100" height="100" class="image" />
<iframe width="420" height="315" src="http://www.youtube.com/embed/k6U-i4gXkLM" frameborder="0" allowfullscreen></iframe>


.image { position: absolute; z-index: 10000; }
Matt
  • 2,317
  • 7
  • 41
  • 52

2 Answers2

0

Your code works perfectly. Just the slash after "../example.png" is unnecessary but it will work anyway.

ofer dofer
  • 631
  • 2
  • 11
  • 28
0

You should be able to add wmode=transparent to the youtube iframe url. See:

Youtube iframe wmode issue

A working example:

http://www.parentmap.local/article/webinar-parents-guide-to-college-admissions

Notice how the flyout menu overlaps the video iframe.

If that won't work for some reason, you could load the youtube preview image using javascript, then put your overlay on top of that. Only load the real iframe when someone actually clicks the element.

Quick googling finds this on youtube images:

http://www.reelseo.com/youtube-thumbnail-image/

Example from that page of preview image URL:

http://img.youtube.com/vi/bQVoAWSP7k4/0.jpg

Community
  • 1
  • 1
Julian
  • 2,814
  • 21
  • 31