Select a youtube resolution and resize the player.
If you are just looking to set quality just use my script https://greasyfork.org/en/scripts/498145-youtube-hd-premium/code. Everything should be fixed there. getPlaybackQuality loads way too late almost all of the time so that has been changed to something else. adisib's script is much too outdated and too many things are broken.
ytPlayer.getPlaybackQuality would be "unknown" if you get it too early, in this case targetRes would be set even if it is actually unavailable.