Skip to content

Instantly share code, notes, and snippets.

@therocco
Last active January 5, 2021 04:48
Show Gist options
  • Save therocco/cfc98672d058496038755137611ea5c8 to your computer and use it in GitHub Desktop.
Save therocco/cfc98672d058496038755137611ea5c8 to your computer and use it in GitHub Desktop.
Force 4K on Stadia

Force 4K VP9 Support in Browser (Chrome/Edge/Webkit)

If you don't want to install an extension to fore 4K VP9 support on Stadia on desktop you can copy and paste the following code into the Chrome Developer Console (ctrl+shift+j) before starting a game. This will tell your browser to use the VP9 codec as well as tricking your browser to load the 4K video stream for the game you are playing.

// set local codec to VP9
localStorage.setItem('video_codec_implementation_by_codec_key', '{"vp9":"ExternalDecoder"}');

// set 4k dimensions and screen values
let x = 3840;
let y = 2160;
let screen = [
    ['availHeight', y],
    ['availWidth', x],
    ['height', y],
    ['width', x]
];

// force new screen resolution
screen.forEach(([prop, value]) => {
    Object.defineProperty(window.screen, prop, { 
        value, 
        configurable: true 
    });
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment