How to play video in HTML 5

How to play video in HTML 5

Posted by Ervin Adams on July 30, 2022

How to play video in HTML 5

How to play video in HTML 5

Posted by Ervin Adams on July 30, 2022

You can use the <video> element to play a video 

  • There is a controls attrubute that gives a user control to do things like play, pause, stop the video
  • There is also width and height attributes for you to define how tall and wide you want the video to be
  • Within the video element there is the source element. The source element allows you to define the video's location and type 

Here is an examples:

Video with controls

<video width="712" height="374" controls>
   <source src="/videos/sample.webm" type="video/webm">
</video>