示例#1
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);
     }
 }