P粉3691966032023-08-24 15:21:28
To make an html 5 element autoplay after the chrome 66 update, you can simply add the muted
attribute to the video element.
So your current video HTML
<video title="Advertisement" webkit-playsinline="true" playsinline="true" style="background-color: rgb(0, 0, 0); position: absolute; width: 640px; height: 360px;" src="http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4" autoplay=""></video>
Just needmuted="muted"
<video title="Advertisement" style="background-color: rgb(0, 0, 0); position: absolute; width: 640px; height: 360px;" src="http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4" autoplay="true" muted="muted"></video>
I believe the chrome 66 update is trying to stop tabs from making random noise on user tabs. That's why the mute attribute makes autoplay work again.