Tutorials

KodeKite Tools

HTML
Flexbox
SVG
Canvas
HTML Tutorial

More


HTML Video Element
Video Element

Video is a HTML5 element used to insert videos or movies clips in a document. It has width, height and controls attributes.

Syntax

<video width="width" height="height" controls>
<source src="URL" type="video/mp4">
</video>


You can define one or more than one video element in a document.


Example


You can use two to three video formates such as .mp4, .ogg, .WebM in video element. Controls attribute used to control the video such as play, pause, stop, volume etc.

Omitting Controls

You can omit controls attribute from video element.


Example


When you omit controls attribute from video you will unable to control video, for example you can not paly, pause, or stop video and do not increse or decrease volume. The video only appears like picture without any control.


Practice Task

Open notepad or any other text editor, follow the following points.


  • Use <video> element to insert video
  • Inside video use <source> element to insert .mp4 formate video
  • Insert text "Sorry your browser does not support video element" to video element
  • Give width of "300" and height of "200" to video

save file with name task.html or task.htm and then open it using any browser and see results.


Solution