How to fix auto play videos and video’s height

Sometimes you may see videos not auto playing in your client’s websites. In that case use the following example codes, it will works like a magic certainly.

<div id=”emon”>
<video loop muted autoplay>
<source src=”https://mydomain.com/wp-content/uploads/2023/07/Final.mp4″>
</video>
</div>

Sometimes when you are trying to change your video’s height, its also change your video’s width. In that case if you want to change your videos height only, then apply the following codes:

#main-container {
width: 90%;
margin: 0 auto;
}
#main-video {
object-fit: fill;
width: 80vw;
height: 50vh;
}

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top