The best HTML <video> tag Tutorial In 2024, In this tutorial you can learn Examples,Browser Support,Tag definitions and instructions,MIME type of audio format,Differences between HTML 4.01 and HTML5,Tips and Notes,Optional attributes,Global Properties,Event Properties,
Play video:
IE 9 +, Firefox, Opera, Chrome and Safari all support <video> tag.
Note: IE 8 or earlier versions of IE browser does not support <video> tag.
<Video> tag defines video, such as a movie clip or other video streams.
Currently, <video> element supports three video formats: MP4, WebM, Ogg.
Browser | MP4 | WebM | Ogg |
---|---|---|---|
Internet Explorer | YES | NO | NO |
Chrome | YES | YES | YES |
Firefox | YES Starting from Firefox 21 version Linux system from Firefox 30 start | YES | YES |
Safari | YES | NO | NO |
Opera | YES Starting from version Opera 25 | YES | YES |
格式 | MIME-type |
---|---|
MP4 | video/mp4 |
WebM | video/webm |
Ogg | video/ogg |
<Video> tag HTML5 is the new label.
Tip: You can place the text between the <video> and </ video> tag, this is not a supported browser <video> element can display information that tag.
New: HTML5 new property.
属性 | 值 | 描述 |
---|---|---|
autoplay New | autoplay | 如果出现该属性,则视频在就绪后马上播放。 |
controls New | controls | 如果出现该属性,则向用户显示控件,比如播放按钮。 |
height New | pixels | 设置视频播放器的高度。 |
loop New | loop | 如果出现该属性,则当媒介文件完成播放后再次开始播放。 |
muted New | muted | 如果出现该属性,视频的音频输出为静音。 |
poster New | URL | 规定视频正在下载时显示的图像,直到用户点击播放按钮。 |
preload New | auto metadata none |
如果出现该属性,则视频在页面加载时进行加载,并预备播放。如果使用 "autoplay",则忽略该属性。 |
src New | URL | 要播放的视频的 URL。 |
width New | pixels | 设置视频播放器的宽度。 |
<video> tag supports HTML global properties .
<video> tag supports HTML event properties .