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 Video and Audio (Retired) Media Basics The Video Element

Jacob Tennyson
Jacob Tennyson
6,240 Points

playing youtube videos on my page

i cant get video to play on my site.

<body>
<div class="main-wrapper">
<header class="main-header">
    <h1 class="main-logo"><a href="index.html"></a></h1>
      <ul class="main-nav">
        <li><a href="location.html"></a></li>
                <li><a href="gear.html"></a></li>
                <li><a href="#"></a></li>
      </ul>
  </header>

<iframe width="1280" height="720" src="//www.youtube.com/embed/PqFFQB64JS8" frameborder="0" allowfullscreen></iframe>




  <footer class="main-footer group">
  <p> &copy VizDsignz</p>
  </footer>
  </div>
</body>
</html>
Jacob Tennyson
Jacob Tennyson
6,240 Points

i used this inside the body <body> <iframe width="1280" height="720" src="//www.youtube.com/embed/PqFFQB64JS8" frameborder="0" allowfullscreen></iframe> </body> ..but keep getting "unable to access file"

..and now my code wont show through once i post it..

Wayne Priestley
Wayne Priestley
19,579 Points

Hi Jacob,

I've edited your code so it appears correct in your post.

Here is a link to explain how to use Markdown to post your code How to post code

If you look at the bottom of the box when your typing a reply you will see Markdown Cheatsheet that will also explain how to post your code.

You have to make sure you have a bit of space under your last line of text in your post. Then you add three back ticks followed by html or css depending on the type of code your inserting.
Then straight after your last line of code you add another three back ticks.
Remember to leave at least a few lines between any text at the top or bottom of your code.

alt text

Hope this helps.

3 Answers

Hi Jacob Tennyson,

There is a simple solution to this problem,

just add "http:" to the beginning of your src attribute, so your code should look like this

<iframe width="1280" height="720" src="http://www.youtube.com/embed/PqFFQB64JS8" frameborder="0" allowfullscreen></iframe>

It should work :+1:

Wayne Priestley
Wayne Priestley
19,579 Points

Hi Jacob,

Works fine for me on codepen though i did change the size so it would fit better in the pen.

Jacob Tennyson
Jacob Tennyson
6,240 Points

@wayne, thanks man. @umar itried that and its still saying unable to access file...im wondering if i need some kind of plugin?

Jacob Tennyson
Jacob Tennyson
6,240 Points

OK! GOT IT! Just forgot that colon. Thanks guys!

You're welcome :)