[Solved??]Change screen aspect ratio to 16:9 to show video, then revert to MV default after it ends?

I have quite a few videos that are 16:9 in aspect ratio that I need to show in my game, is there a way to change the aspect ratio and revert?
I have found quite a few ways to change it but none dynamically.
It's possible, but why not make the whole game 16:9?
you can use the script function to set screen size in an event's script command before and after the play movie, but it needs to be a set screen size for that. But on the other hand you don't want to set it dynamically because if that ends up smaller than the video that video won't play, so that is not a problem.
It's possible, but why not make the whole game 16:9?
It would be hard since I already have countless pictures and events all set considering the default resolution, and I don't mind the default ratio.
you can use the script function to set screen size in an event's script command before and after the play movie, but it needs to be a set screen size for that. But on the other hand you don't want to set it dynamically because if that ends up smaller than the video that video won't play, so that is not a problem.
T̶h̶a̶n̶k̶s̶ ̶f̶o̶r̶ ̶r̶e̶p̶l̶y̶i̶n̶g̶,̶ ̶b̶u̶t̶ ̶I̶ ̶d̶o̶n̶'̶t̶ ̶k̶n̶o̶w̶ ̶h̶o̶w̶ ̶t̶o̶ ̶f̶i̶n̶d̶ ̶t̶h̶i̶s̶ ̶s̶c̶r̶e̶e̶n̶ ̶s̶i̶z̶e̶ ̶c̶h̶a̶n̶g̶e̶ ̶s̶c̶r̶i̶p̶t̶ ̶f̶u̶n̶c̶t̶i̶o̶n̶ ̶x̶D̶.̶ ̶I̶ ̶t̶r̶i̶e̶d̶ ̶s̶e̶a̶r̶c̶h̶i̶n̶g̶ ̶t̶h̶e̶ ̶s̶c̶r̶i̶p̶t̶ ̶c̶a̶l̶l̶s̶ ̶d̶o̶c̶ ̶b̶u̶t̶ ̶t̶h̶e̶r̶e̶ ̶a̶r̶e̶ ̶n̶o̶ ̶r̶e̶s̶u̶l̶t̶s̶ ̶f̶o̶r̶ ̶t̶h̶a̶t̶.̶ nvm I'm almost finding it

Edit 1: I found window.resizeTo(x, y), but it seems it doesn't work for aspect ratio, I'll update here with further results.
you can open a plugin in a text editor to search for the function, for example yanfly's core or the community core as they both contain the function.

but as I said before, you CANNOT use an aspect ratio, you have to use a fixed screen size - preferably the same screen size as the video is in. That way you don't have to bother with calculating aspect ratios.
I'm trying this and it seems nothing is changing 😳
Code:
SceneManager._screenWidth = 1110;
SceneManager._screenHeight = 624;
SceneManager._boxWidth = 1110;
SceneManager._boxHeight = 624;

The code in the community basic looks anything but basic, I probably could spend 1 month and not understand it.

Code:
(function() {
    function toNumber(str, def) {
        return isNaN(str) ? def : +(str || def);
    }

    var parameters = PluginManager.parameters('Community_Basic');
    var cacheLimit = toNumber(parameters['cacheLimit'], 10);
    var screenWidth = toNumber(parameters['screenWidth'], 816);
    var screenHeight = toNumber(parameters['screenHeight'], 624);
    var renderingMode = parameters['renderingMode'].toLowerCase();
    var alwaysDash = parameters['alwaysDash'].toLowerCase() === 'on';
    var windowWidthTo = toNumber(parameters['changeWindowWidthTo'], 0);
    var windowHeightTo = toNumber(parameters['changeWindowHeightTo'], 0);

    var windowWidth;
    var windowHeight;

    if(windowWidthTo){
        windowWidth = windowWidthTo;
    }else if(screenWidth !== SceneManager._screenWidth){
        windowWidth = screenWidth;
    }

    if(windowHeightTo){
        windowHeight = windowHeightTo;
    }else if(screenHeight !== SceneManager._screenHeight){
        windowHeight = screenHeight;
    }


    ImageCache.limit = cacheLimit * 1000 * 1000;
    SceneManager._screenWidth = screenWidth;
    SceneManager._screenHeight = screenHeight;
    SceneManager._boxWidth = screenWidth;
    SceneManager._boxHeight = screenHeight;

    SceneManager.preferableRendererType = function() {
        if (Utils.isOptionValid('canvas')) {
            return 'canvas';
        } else if (Utils.isOptionValid('webgl')) {
            return 'webgl';
        } else if (renderingMode === 'canvas') {
            return 'canvas';
        } else if (renderingMode === 'webgl') {
            return 'webgl';
        } else {
            return 'auto';
        }
    };

    var _ConfigManager_applyData = ConfigManager.applyData;
    ConfigManager.applyData = function(config) {
        _ConfigManager_applyData.apply(this, arguments);
        if (config['alwaysDash'] === undefined) {
            this.alwaysDash = alwaysDash;
        }
    };


    var _SceneManager_initNwjs = SceneManager.initNwjs;
    SceneManager.initNwjs = function() {
        _SceneManager_initNwjs.apply(this, arguments);

        if (Utils.isNwjs() && windowWidth && windowHeight) {
            var dw = windowWidth - window.innerWidth;
            var dh = windowHeight - window.innerHeight;
            window.moveBy(-dw / 2, -dh / 2);
            window.resizeBy(dw, dh);
        }
    };
})();

I will keep trying to decode it and will post here if I manage to.

Edit: This looks too complicated for my low javascript skills, mods can close this thread if needed since I will probably just edit the videos.

Edit 2: After more than almost a day of straight scripting, I managed to make a Frankenstein-like needlessly complicated custom solution that nobody will want to use, but it works lol... So solved I guess.

Original thread: https://forums.rpgmakerweb.com/threads/solved-change-screen-aspect-ratio-to-16-9-to-show-video-then-revert-to-mv-default-after-it-ends.127796/