I've come across a strange issue while using Safari. Whenever I try to play an MP4 video with dimensions of 1920 * 1080, and resize the Safari window to a width of 937px, something strange happens:
https://i.stack.imgur.com/oI50i.png
A black border appears over the video. When I checked the computed style of the video
element, it showed that the width
is not actually 327 but rather 326 - which has left me puzzled.
However, when I tested the same MP4 video in Chrome, everything seemed fine:
https://i.stack.imgur.com/6xD3w.png
No borders were present on the video in Chrome. The computed style for the video
element under Chrome was also as expected:
https://i.stack.imgur.com/9OBOH.png
I attempted to use object-fit: cover
to resolve the issue in Safari, but unfortunately, it didn't work.
Does anyone have any suggestions on how I can fix this problem in Safari?
Edit
Here's a gif demonstrating the issue I'm facing: