createNullableAnswer method
Future<RTCSessionDescription?>
createNullableAnswer(
{ - bool audioRecv = true,
- bool videoRecv = true,
- bool audioSend = true,
- bool videoSend = true,
})
Implementation
Future<RTCSessionDescription?> createNullableAnswer(
{bool audioRecv: true,
bool videoRecv: true,
bool audioSend: true,
bool videoSend: true}) async {
dynamic offerOptions;
if (_context._isUnifiedPlan && !_context._usePlanB) {
await _prepareTranscievers(
audioRecv: audioRecv,
audioSend: audioSend,
videoRecv: videoRecv,
videoSend: videoSend);
} else {
offerOptions = {
"offerToReceiveAudio": audioRecv,
"offerToReceiveVideo": videoRecv
};
}
try {
RTCSessionDescription offer =
await webRTCHandle!.peerConnection!.createAnswer(offerOptions ?? {});
await webRTCHandle!.peerConnection!.setLocalDescription(offer);
return offer;
} catch (e) {
return null;
}
}