There is MediaStreamTrack.applyConstraints() in the spec, but it doesn't seem to be supported in browsers so far, or may have been removed? For me it seems like this is not possible at the moment. Also consider this question in SO .
The only thing that would be in accordance with the above question is to change the flow. One possibility would be to create a new stream with a higher resolution, add this stream, and replace the stream on the other hand. After that you can stop / disconnect the stream.
source share