HTML video src attribute
Browser Support
All major browsers support the src attribute. However, the definition of the file format is not supported by all browsers.
Note: Internet Explorer 8 and earlier versions of IE do not support the <video> tag.
Definition and Usage
src attribute specifies the video file on the local path (URL).
Ogg files using the above example, the use of the normal display in Firefox, Opera and Chrome.
If you need to play the video in Internet Explorer and Safari, you must use the MPEG4 file.
If you want to play a video file in all browsers - in <video> element always use the <source> element. <Source> elements can link to different video files. The browser will use the first recognized format:
Examples
<video width="320" height="240" controls>
<source src="movie.mp4" type="video/mp4">
<source src="movie.ogg" type="video/ogg">
您的浏览器不支持 video 标签。
</video>
<source src="movie.mp4" type="video/mp4">
<source src="movie.ogg" type="video/ogg">
您的浏览器不支持 video 标签。
</video>
try it"
Differences between HTML 4.01 and HTML5
<Video> tag is the new HTML5 tags.
grammar
<video src="URL">
Property Value
值 | 描述 |
---|---|
URL |
视频文件的 URL。 可能的值:
|
HTML <video> tag