Re: No way to specify remote constraints?

On 2 December 2013 10:59, cowwoc <cowwoc@bbs.darktech.org> wrote:
> var videoTrack = remoteMediaStream.getVideoTracks()[0];
> var remoteConstraints = videoTrack.constraints();
> remoteConstraints.mandatory.width = 320;
> remoteConstraints.mandatory.height = 240;
>
> Will this force the remote end to downscale to 320x240 before sending the
> video over the wire?

That won't, because you are modifying something that the browser gave
you to play with.  It won't change anything.

Try

var videoTrack = remoteMediaStream.getVideoTrac
ks()[0].clone(); //!
var remoteConstraints = videoTrack.constraints();
remoteConstraints.mandatory.width = 320;
remoteConstraints.mandatory.height = 240;
videoTrack.applyConstraints(remoteConstraints); //!

That is, assuming that mandatory is not null in the first place.

Received on Monday, 2 December 2013 19:16:19 UTC