我正在尝试利用 HTML5 视频标签在页面加载时自动播放 mov 或 mp4 视频。但是,页面加载时视频未播放。这是我的代码:
<!DOCTYPE html>
<html lang="en-US">
<head>
<meta charset="utf-8" />
<title>Bropocalypse</title>
<style>
body {background:#000000;
margin:100px;}
p {font-size:36px;
text-align:right;
margin:20px 0px;}
a:link, a:hover, a:visited {color:#FF0000;
text-decoration:none;}
.trailer {width:700px;
height:100%;
margin:0 auto;}
</style>
</head>
<body>
<div class="trailer">
<video width="700" height="400" src="trailer.mp4" poster="trailer.mp4" controls="controls" autoplay="autoplay" type="video/mp4; codecs='avc1.42E01E, mp4a.40.2'">
<p>If you are reading this, it is because your browser does not support the HTML5 video element.</p>
</video>
<p><a href="about.php"><img src="images/skip.png" alt="SKIP >>" /></a></p>
</div>
</body>
</html>
该页面可以在这里找到:http ://www.tcnj.edu/~moore56/game-design/bropocalypse/ 。请让我知道您可能有的任何建议或问题。谢谢你。