sendSDP method

dynamic sendSDP (
  1. int handleId,
  2. dynamic callbacks
)

Implementation

sendSDP(int handleId, callbacks) {
  var pluginHandle = this.pluginHandles[handleId.toString()];
  if (pluginHandle == null) {
    Janus.warn("Invalid handle, not sending anything");
    return;
  }

  Janus.log("Sending offer/answer SDP...");
  if (pluginHandle.mySdp == null) {
    Janus.warn("Local SDP instance is invalid, not sending anything...");
    return;
  }
  pluginHandle.pc.getLocalDescription().then((RTCSessionDescription jsep) {
    pluginHandle.mySdp = jsep.sdp;
  }).catchError((error, StackTrace stackTrace) {
    Janus.log(error);
  });

  // FIX ME
  // if (pluginHandle.trickle == false) pluginHandle.mySdp["trickle"] = false;
  Janus.debug(callbacks);
  pluginHandle.sdpSent = true;
  callbacks.success(pluginHandle.mySdp);
}