You cannot modify the resolution of the screen-sharing stream.
When it comes to altering size for the video stream, you can force-set stream resolution using maxWidth and maxHeight parameters. This only works for video stream and not for screen-sharing stream. Screen-sharing has it's own width and height that will ignore these attributes.
However, if you want screen sharing/video to be a specific size, then you can set the width and height of the video element. (Try setting a fixed width and height with object-fit: fill property using css to scale the video element)