I recently wanted to display a simple video on some web page and realized that I didn't know how to do it. I even contemplated putting the video on some video platform just for this purpose -crazy me!- until I remembered the Linux mantra


and found out that you don't need anything more than HTML5 to do this: no plugins like flashplayer, no uploading to any site, no nothing, just my video file, your (decent) browser and this code:

<video width="426" height="240" poster="mythumbnail.jpeg" controls>
   <source src="myfile.mp4" type="video/mp4">
   Sorry, your browser does not support HTML5 video.

assuming the video file myfile.mp4 is in 426x240 mp4 format and mythumbnail.jpeg is the image I want to show for it. The controls option will display start/stop buttons as well as a timeline.

And that's it.


PS: On Debian with Iceweasel/Chromium you just need to make sure that you have the proper video codecs installed: gstreamer1.0-libav, gstreamer1.0-plugins-good will typically be enough.