HTML5 video autoplaying without autoplay attribute
10,345
Try adding this code: autoplay="false"
.
Comments
-
Justin almost 2 years
I have an embedded HTML5 video that is autoplaying on iOs6.0.1 in mobile Safari without the autoplay attribute being present. Any ideas on what is going on or how to stop the autoplaying?
<video width="640" height="480" controls="controls" preload="metadata"> <source src="movie.mp4" type="video/mp4"> <source src="movie.ogg" type="video/ogg"> Your browser does not support the video tag. </video>
Thanks!
-
TheBlackBenzKid over 11 years
autoplay="false" preload="none"
according to w3schools.com/tags/tag_video.asp they're not fully supported... -
Jules over 11 yearsI know that this is a very bad approach, but partial support is better than no support. I'll look into some fallbacks and get back to you, but this should be enough to get the code to work on iOS 6.0.1, no problem.
-
TheBlackBenzKid over 11 yearsI am using the code above but I am also using Flash fallback stackoverflow.com/questions/13840792/…
-
Jules over 11 yearsNo, as in, HTML fallbacks. If you're using Flash on an iOS device, you're missing the point, as iOS and Flash don't tend to play nice. You can use
<embed src="../MyVideoSource.mov"/>
, which is compatible with HTML4.01-Transitional and HTML4.01-Strict, as well as XHTML. It's a bit of a useless precaution, as maybe 1-2% of you visitors will have iOS devices without HTML5 support; Apple is a big player in the HTML5 game. -
Harshit Shah over 4 yearsAccording to MDN, the presence of the
autoplay
attribute, no matter the value, will cause videos to autoplay. developer.mozilla.org/en-US/docs/Web/HTML/Element/video