simo9900 simo9900 - 2 months ago 8
Ajax Question

Showing a preview of a youtube video when setting the link in comment php

I'm trying to develop in my website a preview of youtube link like facebook.

For example: If i set in comment a link of youtube video like https://www.youtube.com/watch?v=7TF00hJI78Y, a preview of this video will be showed in comment.

How can i do this??

Thanks.

Answer

You have to replace the link or url with an Iframe

For you https://www.youtube.com/watch?v=7TF00hJI78Y

you have to replace that text for -->

<iframe width="560" height="315" src="https://www.youtube.com/embed/7TF00hJI78Y" frameborder="0" allowfullscreen></iframe>

Comments