Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Display thumbnail image in iframe

I am fairly new in this. I have the following iframe

<iframe width="560" height="315" src="<%=video1[1]%>" frameborder="0" allowfullscreen></iframe> 

What I am trying to do is have it play video1[1], but show the image that is in video1[2].

I tried doing is:

<iframe width="560" height="315" href="<%=video1[2]%>" src="<%=video1[1]%>" frameborder="0" allowfullscreen></iframe>

but that doesn't work.

Is there a simple way of doing it?

like image 914
A.J Avatar asked Apr 21 '26 13:04

A.J


1 Answers

There's no attribute as 'href' in iFrame tag. See: http://www.w3schools.com/tags/tag_iframe.asp

You could maybe build an iFrame which acts as a target for a link:

<iframe width="560" height="315" src="<%=video1[1]%>" frameborder="0" allowfullscreen name="iframe_video1"></iframe>

<a href="<%=video1[2]%>" target="iframe_video1"><img src="<...>"/></a>

BTW: Pay attention that in an iFrame's source attribute, there has to be a document (i.e. web page) referenced, no media/video directly. You could use YouTube links e.g. to be embedded.

like image 158
Windwalker Avatar answered Apr 23 '26 02:04

Windwalker



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!