Home > OS >  autoplay not working when using controlsList=""
autoplay not working when using controlsList=""

Time:07-08

I want to hide the download option on the controls in the video tag but when I use controlsList="nodownload" It hides the download button from options but autoplay will stop working. I want autoplay to work and hide the download button. How can I fix this? Thanks in advance.

video {
  width: 100%;
  height: 100%;
}
<video src="http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4" controls autoplay controlsList="nodownload"/>

CodePudding user response:

Add the muted attribute. Unfortunately, this is a browser implementation. autoplay and muted go hand-in-hand, see video autoplay considered harmful

video {
  width: 100%;
  height: 100%;
}
<video src="http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4" controls autoplay muted controlsList="nodownload"/>

  • Related