Your browser does not support the <video> element.
video>
The current HTML5 draft specification does not specify which video formats browsers should support in the video tag. But the most commonly used video formats are:
Ogg: Ogg files with Thedora video encoder and Vorbis audio encoder.
mpeg4: MPEG4 file with H.264 video encoder and AAC audio encoder.
We can specify media files using the
XML/HTML Code
Copy content to clipboard
>
<html>
<body>
<videowidth="300"height="200" controls autoplay>
<sourcesrc="/html5/foo.ogg"type="video/ogg"/>
<sourcesrc="/html5/foo.mp4"type="video/mp4"/>
Your browser does not support the <video> element.
video>
body>
html>
Video 属性规范 HTML5 video 标签可以使用多个属性控制外观和感觉以及各种控制功能:
属性
描述
autoplay
如果指定这个布尔值属性,只要没有停止加载数据,视频就会立刻开始自动播放。
autobuffer
如果指定这个布尔值属性,即使没有设置自动播放,视频也会自动开始缓冲。
controls
如果指定这个属性,就允许用户控制视频播放,包括音量控制,快进,暂停或者恢复播放。
height
这个属性以 CSS 像素的形式指定视频显示区域的高度。
loop
如果指定这个布尔值属性,表示允许播放结束后自动回放。
preload
指定这个属性,视频会在载入页面时加载并准备就绪。如果指定自动播放则忽略。
poster
这是一个图像 URL,显示到用户播放或快进。
src
要嵌入的视频 URL。可选,可以在 video 块中使用
width
这个属性以 CSS 像素的形式指定视频显示区域的宽度。
Embed audio HTML5 supports the
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn