Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why is my YouTube video not showing up?

I am simply trying to have a YouTube video show up on my site, but instead I'm getting a blank shape of the video. Does anyone know why this could be or how to fix it? Thanks. Here is the portion of my code:

<DOCTYPE html>
<html>
<head>
</head>
<body>
<iframe width="420" height="345" 
src="http://www.youtube.com/watch?v=nIsCs9_-LP8">
</iframe>
</body>
</html>
like image 395
Sarah Avatar asked Nov 07 '13 02:11

Sarah


1 Answers

The key issue is the Youtube URL is missing the embed part. Every Youtube video has a embedded option.

You have:

http://www.youtube.com/watch?v=nIsCs9_-LP8

However we need to remove watch?v= and add embed/:

http://www.youtube.com/embed/nIsCs9_-LP8

The first link is meant for the Youtube site (not just the video, but the whole site) itself. The second is a version for the video itself which is what you need to embed onto your site.

Try this (straight from the Youtube video's embed option):

<iframe width="420" height="315" src="http://www.youtube.com/embed/nIsCs9_-LP8" frameborder="0" allowfullscreen></iframe>
like image 154
But I'm Not A Wrapper Class Avatar answered Nov 03 '22 00:11

But I'm Not A Wrapper Class