WebRTC - change video resolution in the middle of a connection

I know that I can determine the resolution of the video stream in the initialization state:

var video_constraints = { mandatory: { maxHeight: 480, maxWidth: 640 }, optional: [] }; navigator.getUserMedia({ audio: false, video: video_constraints }, onsuccess); 

I am wondering if there is a way to change the resolution of the video stream in the middle of the connection, i.e. after initialization?

+5
source share
1 answer

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.

+3
source

All Articles