St Koi
St Koi

Reputation: 13

WebRTC - getting 'malformed constraints object'

I am using Chrome ans working on a webRTC application. I am getting an error 'malformed constraints object' in the createAnswer() for a session Description offer

pc.createAnswer(gotDescription, errorHandler, constraints);

I have tried all the options such as

constraints = {'mandatory': {
                'offerToReceiveAudio': true,
                'offerToReceiveVideo': true}};
constraints = {'offerToReceiveAudio': true,
           'offerToReceiveVideo': true};

and with both capital and small 'o' but still the same error.

Any suggestions?

Upvotes: 1

Views: 772

Answers (1)

Gurpreet Sachdeva
Gurpreet Sachdeva

Reputation: 318

It seems in the latest Specs, the audio/video offers are not required any more in RTCOfferOptions, so you may omit that unless you want to specify the iceRestart option which default is false.

http://w3c.github.io/webrtc-pc/#idl-def-RTCOfferOptions

pc.createAnswer(gotDescription, errorHandler);

Upvotes: 3

Related Questions