anyone could help me

If anyone could help me out I would appreciate it. I’m looking for a way I can force 2560×1080 (21:9) when I play a video (any res), but toggles back to 1920×1080 when I exit the video. Sort of like a whitelist set to “on start/stop”, but toggles regardless of the video resolution. Many thanks!