Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

HTML

Deep Dive - HTML - Objects - Embedded Elements *Require Help*

Hello,

I am currently on Deep Dive - HTML - Objects - Embedded Elements. I am doing exactly as Nick instructs, about how to take the embedded code from youtube and also selecting the old code box, and for some reason the embedded video isn't showing up - it just has space where it should be. Sometimes when refreshing the page a black box will flash where the video would be but then just shows extra space where the video should be showing up. I was hoping someone could just explain why its doing this - whether its something I am doing wrong or if there is another reason. I have tried opening my 'index.html' in Chrome, FireFox and Internet Explorer and none of them are showing the video.

Thanks.

<object width="560" height="315">
            <param name="movie" value="//www.youtube.com/v/y6GaPkkGZGw?hl=en_GB&amp;version=3"></param>
            <param name="allowFullScreen" value="true"></param>
            <param name="allowscriptaccess" value="always"></param>
            <embed src="//www.youtube.com/v/y6GaPkkGZGw?hl=en_GB&amp;version=3" type="application/x-shockwave-flash" width="560" height="315" allowscriptaccess="always" allowfullscreen="true"></embed>
</object>

This is the code I am using.

4 Answers

As crazy as it may seem, and I hope someone can explain this, but when embedding YouTube videos it needs to be on a server? I also have trouble's having the video show up locally unless I upload it to my server. I took your code and tried it out locally, and nothing. But, when I uploaded it to a server, that's when it actually shows up.

Try that and see if it works?

And if anyone can explain the reason behind this and a possible full solution, that would be awesome!

Cool thanks Aaron, so I need to upload my index.html to a server and it should work?

Yes, try that and let me know how it works out for you! I hope someone can reply to this, explaining why though.

I have just uploaded it to one of my domains and it works. So for some reason it just doesn't like working locally...

Awesome! Yeah, but I apologize, I wish I could explain why this happens.