I wonder what I\'m doing wrong.
I\'m getting \'malformed constraints object\' errors from this:
pc.createAnswer( function (answer) {
...
}, fail, {
According to the newest Webrtc spec the correct form of the constraint parameter should be:
{ offerToReceiveAudio: true, offerToReceiveVideo: true }
Note the lowercase 'o's at the beginnings of offerToReceiveAudio
and offerToReceiveVideo
.
This is currently supported only by FF 33 or newer.
Chrome supports only the own way:
{ mandatory: { OfferToReceiveAudio: true, OfferToReceiveVideo: true } }
Chrome will throw and error if you give it a constraint object that has a structure according to the new spec.
The good news is that Firefox still accepts the old form. It just prints a warning message in that case. So, at least for now, use the old version.