How to prevent html5 video from loading before playing?

Will Ryan picture Will Ryan · Jan 13, 2013 · Viewed 47.3k times · Source

I have several html5 videos on one page and I've just realized that when you visit the page, all the videos start loading even though I haven't clicked play on any of them.

Is there a way to only load a video once you click play, to prevent unnecessary downloading?

Answer

Timothy Radzikowski picture Timothy Radzikowski · Jan 13, 2013
<!DOCTYPE html>
<html>
<body>

<video width="320" height="240" controls="controls" preload="none">
  <source src="movie.mp4" type="video/mp4" />
  <source src="movie.ogg" type="video/ogg" />
  Your browser does not support the video tag.
</video>

</body>
</html>

Use Preload"none"

http://diveintohtml5.info/video.html