Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

WebRTC - change video resolution in the middle of communication

I know I can define video stream resolution at the initialization state:

var video_constraints = {
  mandatory: {
    maxHeight: 480,
    maxWidth: 640 
  },
  optional: []
};

navigator.getUserMedia({
  audio: false,
  video: video_constraints
}, onsuccess);

I'm wondering is there any way I can change video stream resolution in the middle of communication, i.e. after initialization?

like image 775
Limon Monte Avatar asked Apr 20 '15 14:04

Limon Monte


1 Answers

There is MediaStreamTrack.applyConstraints() in the spec but it doesn't look like it is supported in the browsers so far or maybe it was removed? For me it looks like this is not possible at the moment. Also take a look at this question at SO.

The only thing would be according to the question above to change the stream. One possibility would be to create a new stream with higher resolution, add that stream and replace the stream on the otherside. Afterwards you can stop/detach the stream.

like image 152
Robert Avatar answered Oct 04 '22 16:10

Robert