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

Cheree Carlson
Cheree Carlson
2,525 Points

When I copied the code to embed this movie from Youtube, the copied text/info did not include "http:" Why is that?

it did have "//.youtube.com........" but not the complete link. Because of this, the video would not show on my "page" I created. I read through the embed link and discovered this and added "http:" and it now works. Is this common when copying an embed object code from Youtube or other sites? Did I do something incorrect when copying the embed code from Youtube?

2 Answers

There seems to be a good explanation here: https://productforums.google.com/forum/#!topic/youtube/U8td_YIrbCQ

Quote from a user on the Google forums: "...it allows the client browser to use which ever protocol (HTTP or HTTPS) depending on the current state of the browser. In other words, if you are on your banking site on a secure page using HTTPS, clicking on the embed will request the video also in HTTPS. The same code when used on an unsecured page will request the video via HTTP."

So, the embed codes without "http:" will work properly online, but for offline testing, they won't work.

Cheree Carlson
Cheree Carlson
2,525 Points

Thank you for your help and taking the time to explain this to me! I really appreciate it!

No problem!