W3C home > Mailing lists > Public > public-webrtc@w3.org > December 2013

Re: No way to specify remote constraints?

From: Martin Thomson <martin.thomson@gmail.com>
Date: Mon, 2 Dec 2013 11:15:51 -0800
Message-ID: <CABkgnnVThmV+nSxWO3ZG2kxz7xt=k7uFw+oEPSkxYc_oSKM48A@mail.gmail.com>
To: cowwoc <cowwoc@bbs.darktech.org>
Cc: "public-webrtc@w3.org" <public-webrtc@w3.org>
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

This archive was generated by hypermail 2.3.1 : Monday, 23 October 2017 15:19:37 UTC