jack kennedy jack kennedy - 4 months ago 10x
HTML Question

HTML and CSS: How to play video on website

I have this website where I post projects and articles, just for fun. I was wondering how I could post videos. I know you can easily put YouTube videos on your website but I don't want to be known as a YouTube. What are the different methods of implementing videos on my site that doesn't require users to download flash player etc. Thanks - Jack


You can use a simple html5 video tag

<!-- Simple video example -->
 <video src="videofile.webm" autoplay poster="posterimage.jpg">
     Sorry, your browser doesn't support embedded videos, 
     but don't worry, you can <a href="videofile.webm">download it</a>
       and watch it with your favorite video player!

see mdn for more https://developer.mozilla.org/it/docs/Web/HTML/Element/video

<video width="480" controls poster="https://archive.org/download/WebmVp8Vorbis/webmvp8.gif" >
   <source src="https://archive.org/download/WebmVp8Vorbis/webmvp8.webm" type="video/webm">
   <source src="https://archive.org/download/WebmVp8Vorbis/webmvp8_512kb.mp4" type="video/mp4">
   <source src="https://archive.org/download/WebmVp8Vorbis/webmvp8.ogv" type="video/ogg">
   Your browser doesn't support HTML5 video tag.