<video src="video/puppy.mp4"
poster="images/puppy.jpg"
width="400" height="300"
preload
controls
loop>
<p>A video of a puppy playing in the snow</p>
</video>
</body>
src来源
poster加载或播放前显示的图像
width,height宽,高
controls浏览器提供额外控件
autoplay自动播放
loop循环播放
preload:none不点击播放前不加载视频
auto加载
metadata收集少量信息。
<video poster="images/puppy.jpg" width="400" height="320" preload controls loop>
<source src="video/puppy.mp4" type='video/mp4;codecs="avc1.42E01E, mp4a.40.2"' />
<source src="video/puppy.webm" type='video/webm;codecs="vp8, vorbis"' />
<p>A video of a puppy playing in the snow</p>
</video>
type说明视频格式
codecs编码类型
2.audio加载音频
<audio src="audio/test-audio.ogg" controls autoplay>
<p>This browser does not support our audio format.</p>
</audio>
3.多个音频源
<audio controls autoplay>
<source src="audio/test-audio.ogg" />
<source src="audio/test-audio.mp3" />
<p>This browser does not support our audio format.</p>
</audio>
标签:视频,播放,添加,video,html5,our,audio,加载
From: https://www.cnblogs.com/zhongta/p/18441673