Monday 30 June 2014

youtube embed code iframe not working in html for my website

SOLUTION of  youtube embed code not working in website
  
      Embed code of youtube comes with two options
1. iframe code
2.old embed code
     
      recently i started facing problem whenever i put youtube embed code it shows blank space only.

HERE IS THE SOLUTION


  • 1.FIRST CHECK THE "SRC=" that must starts with HTTP or in some case HTTPS

like eg.
<iframe width="420" height="315" src="//www.youtube.com/embed/Vcu_wT5uu0s" frameborder="0" allowfullscreen></iframe>

look at this iframe code in "src=" there is no HTTP

correct form of this code is:

<iframe width="420" height="315" src="http://www.youtube.com/embed/Vcu_wT5uu0s" frameborder="0" allowfullscreen></iframe>


  • 2. JUST REMOVE THE frameborder="0" allowfullscreen in iframe code

some browser might not support frameborder="0" allowfullscreen



so,correct manner of the code is:



<iframe width="420" height="315" src="http://www.youtube.com/embed/Vcu_wT5uu0s"></iframe>



or you can also try this

<embed width="420" height="345"
src="http://www.youtube.com/embed/Vcu_wT5uu0s"
type="application/x-shockwave-flash">



FULL HTML CODE WILL BE LIKE THIS

<!DOCTYPE html>
<html>
<body>

<iframe width="600" height="345"
src="http://www.youtube.com/embed/Vcu_wT5uu0s">
</iframe>

</body>
</html>
-----------------------------------------------
 last but not the least DON'T jump between html and text code while uploading it may corrupt your code.

YOU CAN CHANGE HEIGHT AND WIDTH AS PER YOUR REQUIREMENT


No comments:

Post a Comment