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

Jesus Valdivia
Jesus Valdivia
7,198 Points

Embedded Video not working

Hi guys. I just watched the video about how to embed video in HTML and it is not working. I tried Chrome, Firefox and IE in 2 different Laptops and it didn't work.

The code is the same as the video "Embedded Elements" in the Objects chapter from the HTML series.

I just get a blank page and if i right click i get a floating window that says (in spanish) "movie didn't load" and the Flash Player version. Any help, please?

Thanks

5 Answers

Hi Jesus!

I just had the same problem! and solved it :)

check both of the URL's that are in your code. Both have a missing "http:" in the beginning

just add it so it looks like a normal URL: http://www.youtube.com/v/v/rcSUeNIUwsA?version=3&hl=es_MX

James Barnett
James Barnett
39,199 Points

The issue you are seeing is just a limitation of codepen & HTML pages loaded without a web server.

Your code works fine in jsbin:

http://jsbin.com/edemeq/1/edit


Some more details:

If you鈥檙e curious why the script reference is missing the leading http:, that鈥檚 a helpful trick which allows you to use a single reference that works on both HTTP and HTTPS pages.

The main caveat to keep in mind when using the protocol-less reference is that it will fail on pages loaded via file:/// (i.e. HTML pages you load directly from disk to your browser). So, do be sure to include the http: protocol in the URL if you happen to be developing without a web server at all, but don鈥檛 worry about omitting it otherwise.

Source: http://encosia.com/3-reasons-why-you-should-let-google-host-jquery-for-you/

Jesus Valdivia
Jesus Valdivia
7,198 Points

Thank you James for the explanation. I see now why it didn't work when I load the file from my hard disk. It was driving me crazy.

Jesus Valdivia
Jesus Valdivia
7,198 Points

Hi. Well I just want to know if anyone else can make the code work to embed video like the example in the video I mentioned, or if I have to try somethign else.

This is the second time I watch the HTML videos and I think the first time worked without problems, that's why I asked.

Thanks again for any tips or help.

Chezki Indursky
Chezki Indursky
3,500 Points

Can you show me the code you use?

Jesus Valdivia
Jesus Valdivia
7,198 Points

Hi. thanks for the reply. Here is the code, it is an example as the video i mentioned, I tried to embed a youtube video:

http://codepen.io/anon/pen/mtEuD

Any ideas? I think i'm doing something wrong.

Jesus Valdivia
Jesus Valdivia
7,198 Points

Hi Guillermo. Thank you so much for the tip, it worked. I just have to add an "s" at the end of the protocol, like this: https://

I don't know if it is a region issue or something with youtube, but it works now. Thanks again.