Change splitscreen layout in game

I am making a local 2 player game, and I wanted to add an option on the menu that would switch the splitscreen layout between horizontal and vertical. That setting is available in the project settings, but I cannot find a way to change it through blueprints. Is there a way to do that ?
I am working with Unreal Engine 4.21.

It is not possible through blueprints. You must use UGameViewportClient class to implement this using C++.