0

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!

  • Either test your webpage on a web server or use URLs with explicit protocols. –  Jan 26 '15 at 23:33

2 Answers2

2

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).

Quentin
  • 914,110
  • 126
  • 1,211
  • 1,335
  • Thank you for the information, i'll make sure next time i do it right! –  Jan 26 '15 at 23:53
2

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.

Oueslati Bechir
  • 962
  • 2
  • 10
  • 15
  • that does seem to fix the problem but is there a way to remove the ads showing in the video? Also the console gets flooded with 5 errors of cast_sender.js –  Jan 26 '15 at 23:38
  • i read that i need permission for ads removal from the owner of the video, so thats out, but what do i do with the errors? –  Jan 26 '15 at 23:42
  • I have no idea about the js error, but referring to this [thread](http://stackoverflow.com/questions/24490323/google-chrome-cast-sender-error-if-chrome-cast-extension-is-not-installed-or-usi), it seems a known issue. – Oueslati Bechir Jan 26 '15 at 23:50
  • thanks, its not a big deal since it doesnt interfere with the site! –  Jan 26 '15 at 23:52