添加音频
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<audio controls autoplay loop muted>
<source src="./media/music.mp3">
<source src="./media/music.ogg">
</audio>
</body>
</html>
添加视频
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<!--
controls:控制播放暂停的按钮
autoplay:自动播放
loop:无限循环
muted:静音
poster:视频封面
-->
<video width="500" height="300" controls loop autoplay muted poster="./media/rt.jpg">
<source src="./media/explore_promo.mp4">
<source src="./media/video.mp4">
</video>
</body>
</html>