public static Task <SessionDescription> CreateOfferAsync(this IPeerConnection self, MediaConstraints mediaConstraints) { var observer = new SdpObserver(); self.CreateOffer(mediaConstraints, observer); return(observer.OnCreateAsync()); }
public PeerConnectionClient(PeerConnectionParameters parameters, IPeerConnectionEvents peerConnectionEvents, ILogger logger = null) { _parameters = parameters; _peerConnectionEvents = peerConnectionEvents; _executor = ExecutorServiceFactory.CreateExecutorService(TAG); _logger = logger ?? new ConsoleLogger(); _observer = new SdpObserver(this); _peerConnectionListener = new PeerConnectionListener(this); }
public static async Task <bool> SetLocalDescriptionAsync(this IPeerConnection self, SessionDescription sdp, bool throwIfFails = false) { try { var observer = new SdpObserver(); self.SetLocalDescription(sdp, observer); return(await observer.OnSetAsync()); } catch { if (throwIfFails) { throw; } return(false); } }