AlexKMDev / WebRTC

Unofficial builds of Google WebRTC iOS Framework
https://webrtc.org/native-code/ios/
Other
292 stars 76 forks source link

Add multiple mediaConstraints #17

Closed DustinBel closed 7 years ago

DustinBel commented 7 years ago

Is it possible to add more constrains? Because the current interface supports:

init(mandatoryConstraints mandatory: [String : String]?, optionalConstraints optional: [String : String]?)

So I can pass only 1 constraint. Is it possible to submit more mediaConstraints? Like OfferToReceiveAudio, OfferToReceiveVideo etc.

AlexKMDev commented 7 years ago

You can pass an dictionary of constraints, not just one.

RTCMediaConstraints(mandatoryConstraints: [
    "OfferToReceiveVideo": "true",
    "OfferToReceiveAudio": "false"
    ], optionalConstraints: [
     "DtlsSrtpKeyAgreement": "true",
     "googCpuLimitedResolution": "false"
    ]
)