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 HTML Objects Embedded Elements

Daria Kotenko
Daria Kotenko
1,528 Points

Doesn't work

Tried in Safari and Chrome - blank page.

What doesn't work??

Calvin Nix
Calvin Nix
43,828 Points

Could you provide the code you are trying?

Daria Kotenko
Daria Kotenko
1,528 Points

Embed Media. Right click: "Movie not loaded..."

<!DOCTYPE HTML>

<html lang="en">
    <head>
        <meta charset="utf-8">
        <title>My Page</title>
    </head>

    <body>

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

    </body>


</html>

5 Answers

Daniel Burt
Daniel Burt
3,699 Points

I looked this up as I'm probably at a similar stage (slightly different path) of the HTML course as a refresher after 10 years of not coding and was interested to see if I could work it out (especially as it didn't work on my browser).

Firstly, you are using Youtube's OLD embed code. That has a bug which means it leaves out the "http:" element before the "//www.youtube...". Changing this alone may make your code work.

I then looked on the W3C website to see if they had some support for this, and they do! It is an old post, but as the embed code is also old then the two pair up nicely. You can find that page here: http://www.w3.org/blog/2008/09/howto-insert-youtube-video/

If you tally up the code with the W3C post, it should be explained a bit clearer. I think though, this might be more of an issue with YT's embed code, than it is anything you wrote as the actual process of embedding should be very simple (it certainly used to be).

<!DOCTYPE HTML>

<html lang="en">
    <head>
        <meta charset="utf-8">
        <title>My Page</title>
    </head>

<body>

<!-- This works -->

  <object width="425" height="349" 
        type="application/x-shockwave-flash"
        data="http://www.youtube.com/v/_OBlgSz8sSM?version=3&amp;hl=en_US">
         <param name="movie" value="//www.youtube.com/v/_OBlgSz8sSM?version=3&amp;hl=en_US"/>
        <p>Interview of Philippe Le HΓ©garet about Video codec</p>
    </object>

<!-- I added the <br> to make things easier to see on my own computer when I was doing this and a load of other things -->
<br>

<!β€” This, YouTube’s official old embed code, does not β€”>

<object width="420" height="315">

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


</html>
Daria Kotenko
Daria Kotenko
1,528 Points

Hey Daniel! Adding "http:" worked! Even though Nick (the teacher) emphasised that we should use the old code, he didn't mention this. Thank you so much!

Calvin Nix
Calvin Nix
43,828 Points

Great answer Daniel. I knew the "//www.youtube....." looked weird but I didn't question Youtube's all mightiness :P

Daria Kotenko
Daria Kotenko
1,528 Points

Right click: "Movie not loaded..."

Right click what?? If asking for help in the forum you need to give as much information as possible. Help us to help you!!!

Daria Kotenko
Daria Kotenko
1,528 Points

Stop panicking, it's the first time I'm trying to use help. I started discussion next to the video about embed media, it seemed logical that people will see, what I ask about exactly. I just don't know how the forum works here, sorry. I already provided the information.

Calvin Nix
Calvin Nix
43,828 Points

Hey Daria,

Could you please try to do this with a different video?

I tested your code and received the same error.

Daria Kotenko
Daria Kotenko
1,528 Points

I did, it was the same. I'm gonna try a third one.

Daria Kotenko
Daria Kotenko
1,528 Points

No luck.

<!DOCTYPE HTML>

<html lang="en"> <head> <meta charset="utf-8"> <title>My Page</title> </head>

<body>

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

</body>

</html>

Calvin Nix
Calvin Nix
43,828 Points

Hey Daria,

I'm still looking into your issue. For some reason I am also unable to accomplish this also, yet I have done it many times before.

Daria Kotenko
Daria Kotenko
1,528 Points

Thank you so much, Calvin, for your attention. I guess it's some kind of a general temporary problem, and I just was in the wrong place at the wrong time, it happens:)

Thank you anyway, I'll check it again later, hopefully it'll work.

Take care!

Daniel Burt
Daniel Burt
3,699 Points

No worries, glad to be of help!

I'm glad the first part worked, because the second bit was technically speaking, quite abstract compared to what we were actually trying to achieve :)