Inconsistent playback of HTML5 video with variable resolution across browsers

I have a video that has changes in aspect ratio. Firefox and Edge play the video without problem, when it detects an aspect ratio change it just scales down or up the video to fill the player.

On the other hand, Chrome and Brave try to maintain the video's aspect ratio and zoom-in the video which means that the video is distorted.

You can see an example here:

The example uses video-js but the same thing happens with the native player.

I want to have some custom javascript to handle these cases by changing the source file for Chrome. However, I know it's bad practice to detect browsers but rather it's better to customize javascript based on browser features.

So my question is if there's a feature that I can detect that controls this video playback behaviour