Within my website, I have incorporated a <video>
element nestled inside a <div>
. This particular <div>
serves the purpose of defining the video aspect ratio, allowing users to adjust it if necessary (for instances where the encoded video has an incorrect ratio). The contents of the <div>
are always displayed within the confines of the container using the CSS property "object-fit: fill;"
.
However, there seems to be an issue when the user switches to fullscreen mode as the screen then becomes the main container. This poses a challenge due to the various display ratios across different devices.
Is there a method to manipulate or restrict the size of the fullscreen view?
<div style="width: 960px; height: 540px; background: #bfbfbf; display: block; margin: 0 auto;">
<video style="object-fit: fill;">
<source src="" />
</video>
</div>