After browsing numerous discussions on this topic, I have encountered an issue where adding a poster image to the video element causes the size of the video player to change.
<video src="/video.mp4" poster="/image.jpeg" class="videoPlayer" controls playsinline />
.videoPlayer {
cursor: pointer;
object-fit: cover;
}
img, video {
max-width: 100%;
height: auto;
}
img, svg, video, canvas, audio, iframe, embed, object {
display: block;
vertical-align: middle;
}
I am curious about the potential reasons behind why the video size is being impacted by the presence of an image. Any insights or solutions would be greatly appreciated.