javascript - embedded video disappearing just after page loads -


using google chrome browser (windows/mac), happens me following code displays video preview when page loads, after 1 second preview disappears. tried in 5 different computers google chrome browser. on other computer google chrome browser preview didn't disappear (just 1/6 of tries works properly).

<html xmlns="http://www.w3.org/1999/xhtml">  <head> <style type="text/css" media="all"> .container {     overflow: hidden; } </style> </head>  <body>     video 1:<br />     <div class="container">         <div>             <iframe                 frameborder="0"                 src="https://www.youtube.com/embed/juqyzgnbspy"                 width="385" height="217"                 align="left"             >             </iframe>         </div>     </div>     video 2:<br />     <div class="container">         <div>             <iframe                 frameborder="0"                 src="https://www.youtube.com/embed/juqyzgnbspy"                 width="385" height="217"                 style="float:left"             >             </iframe>         </div>     </div> </body>  </html> 

here have jsfiddle: https://jsfiddle.net/rqwb5l67/

(remember use google chrome)

as can see above, there 2 variants of code. 1 using attribute: align, , other using css property: float (on iframe).

any idea on why happening?

this minimized version of bigger code, so, i'm gonna need try different solutions 1 fits needs.

thanks.

remove overflow hidden style , works...

updated fiddle.

https://jsfiddle.net/rqwb5l67/2/

give divs height , width , iframe

video 1:<br /> <div class="container">     <div class="frame1">         <iframe             frameborder="0"             src="https://www.youtube.com/embed/juqyzgnbspy"             width="385" height="217"          >         </iframe>     </div> </div> video 2:<br /> <div class="container">     <div>         <iframe             frameborder="0"             src="https://www.youtube.com/embed/juqyzgnbspy"             width="385" height="217"             style="float:left"         >         </iframe>     </div> </div>   .frame1{   width:100%;   height:217px;   text-align:center; } 

Comments

Popular posts from this blog

ios - MKAnnotationView layer is not of expected type: MKLayer -

ZeroMQ on Windows, with Qt Creator -

unity3d - Unity SceneManager.LoadScene quits application -