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?
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With