示例#1
0
        public static Task <SessionDescription> CreateOfferAsync(this IPeerConnection self,
                                                                 MediaConstraints mediaConstraints)
        {
            var observer = new SdpObserver();

            self.CreateOffer(mediaConstraints, observer);
            return(observer.OnCreateAsync());
        }
示例#2
0
        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);
        }
示例#3
0
 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);
     }
 }