user3502346
user3502346

Reputation:

Iframe File not found error

I've been trying to run a youtube video with an iframe, and everytime i reload the page i get the following error on the console:

 GET www.youtube.com/embed/9kkjr4qcrkE?rel=0&controls=0&showinfo=0;autoplay=1;:1

file://www.youtube.com/embed/9kkjr4qcrkE?rel=0&controls=0&showinfo=0;autoplay=1; net::ERR_FILE_NOT_FOUND

I dont have any mistakes in my html so i'm really mad about this and cant seem to find the solution:

<div id="content">
    <iframe width="853" height="480" src="//www.youtube.com/embed/9kkjr4qcrkE?rel=0&amp;controls=0&amp;showinfo=0;autoplay=1;" frameborder="0" frameborder="0" allowfullscreen=""></iframe>
</div>

Thanks in advance for looking over, if you need more code just ask!

Upvotes: 0

Views: 8941

Answers (2)

Oueslati Bechir
Oueslati Bechir

Reputation: 970

You have to add http or https: to the URL. // means that you are using the current scheme from where you are calling your page.

Upvotes: 2

Quentin
Quentin

Reputation: 944532

Starting a URL with // means "Use the same scheme as the URL for the current page".

If you are using HTTP, it uses HTTP.

If you are using HTTPS, it uses HTTPS.

If you are using FILE (as you are), it uses FILE.

You don't have a copy of YouTube's filesystem on your hard disk.

Do your testing on a local web server (or use absolute URLs which include the scheme, but it is better to have a web server for testing web stuff).

Upvotes: 2

Related Questions