HTML Video Tag
Here is a video tag:
<video src="../kbd/i2/huawei_laptop_camera_key.mp4" controls></video>
browser shows:
Specifying Multiple Video Formats
If you have multiple video formats, you can use the “source” tag. Browser will pick the one it understands or most suitable. Example:
<video controls> <source src="mymovie.ogg" type="video/ogg"> <source src="mymovie.mp4" type="video/mp4"> Your browser does not support the video element. </video>
Video Tag Attributes
Optional attributes.
preload
-
none
,metadata
,auto
controls
- Show control panel. • Does not take any value
autoplay
- Start to play automatically. • Does not take any value
loop
- Loop playback. • Does not take any value
width
- value is integer, in pixels
height
- value is integer, in pixels
poster
-
example:
… poster="image.jpg" …
Video Formats Browser Support
format/browser | Chrome | Safari | Firefox | Edge |
---|---|---|---|---|
.mp4 | yes | yes | yes | yes |
.webm | yes | no | yes | yes |
.mkv | yes | no | no | yes |