--- title: HTML5 Video localeTitle: HTML5视频 --- ## HTML5视频 在HTML5之前,为了在网页中播放视频,您需要使用插件,如Adobe Flash Player。随着HTML5的引入,您现在可以将其直接放入页面本身。 HTML 标签用于在Web文档中嵌入视频。它可能包含一个或多个视频源,使用src属性或[source](source)元素表示。 要将视频文件嵌入到网页中,只需添加此代码段并更改音频文件的src即可。 \`\`\`HTML 您的浏览器不支持视频元素。请将其更新至最新版本。 ``` The controls attribute includes video controls, similar to play, pause, and volume. This feature is supported by all modern/updated browsers. However, not all support the same video file format. My recommendation for a wide range of compatibilty is MP4, as it is the most widely accepted format. There are also two other formats (WebM and Ogg) that are supported in Chrome, Firefox, and Opera. The element enables you to indicate alternative video files which the browser may choose from. The browser will utilize the first recognized format. In HTML5, there are 3 supported video formats: MP4, WebM, and Ogg. The text between the tags will only be displayed in browsers that do not support the