Tasawer Khan
Tasawer Khan

Reputation: 6148

Why does this link not work?

<iframe id="video" src="https://www.facebook.com/video/embed?video_id=10151798532949501" height="360" width="480" frameborder="0"></iframe>


<a href="http://vimeo.com/73449305" target="video">Test</a>

I have this code and it does not work. Am I doing something wrong?

Upvotes: 1

Views: 117

Answers (2)

Rohit
Rohit

Reputation: 300

The link for the vimeo video is not correct, to get the right link look at the embedded code under the "Share" option in vimeo. In this case, the link is: http://player.vimeo.com/video/73449305

so replace it with the following:

<iframe name="video" src="https://www.facebook.com/video/embed?video_id=10151798532949501" height="360" width="480" frameborder="0"></iframe>

<a href="//player.vimeo.com/video/73449305?title=0&amp;byline=0&amp;portrait=0&amp;color=ffffff" target="video">Test</a>

Edit: As pointed out by Pietu1998, iframe name should be set to video for it to properly work in Firefox.

Upvotes: 2

electrikmilk
electrikmilk

Reputation: 1043

Can you just try changing the src with JavaScript?

HTML:

<iframe src="https://www.facebook.com/video/embed?video_id=10151798532949501"></iframe>

<a href="#" onclick="changeVideo('http://vimeo.com/73449305');">Test</a>

JavaScript

function changeVideo(loc) {
document.getElementById['videoframe'].src = loc;
}

By the way some sites do not allow you to open them in iframe (security reasons - clickjacking) (the html way you did it)

Hope this helps :)

Upvotes: 0

Related Questions