问题
I have a mp4 video to automatically play on website, but it doesn't play on iphone. Referring to other Q & A about the same issue, I added "playsinline" to the video tag.
However it doesn't seem to work and nothing is displayed on the screen of my iphone.
Could anyone help me find out what is wrong with my code?
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
<style>
body {
background: #ffffff;
padding: 0;
margin: 0;
}
video {
width: 500px;
height: 500px;
}
</style>
</head>
<body>
<video autoplay loop muted playsinline class="video-background ">
<source src="video01.mp4" type="video/mp4">
</video>
</div>
</body>
</html>
来源:https://stackoverflow.com/questions/55701447/mp4-video-not-playing-on-iphone