public static RTCConfiguration ToNative(this Abstraction.RTCConfiguration self)
 {
     return(new RTCConfiguration
     {
         IceServers = self.IceServers.ToNative().ToArray(),
         IceTransportPolicy = self.IceTransportPolicy.ToNative(),
         BundlePolicy = self.BundlePolicy.ToNative(),
         RtcpMuxPolicy = self.RtcpMuxPolicy.ToNative(),
         TcpCandidatePolicy = self.TcpCandidatePolicy.ToNative(),
         CandidateNetworkPolicy = self.CandidateNetworkPolicy.ToNative(),
         AudioJitterBufferMaxPackets = self.AudioJitterBufferMaxPackets,
         AudioJitterBufferFastAccelerate = self.AudioJitterBufferFastAccelerate,
         IceConnectionReceivingTimeout = self.IceConnectionReceivingTimeout,
         KeyType = self.KeyType.ToNative(),
         ContinualGatheringPolicy = self.ContinualGatheringPolicy.ToNative(),
         IceCandidatePoolSize = self.IceCandidatePoolSize,
         ShouldPruneTurnPorts = self.ShouldPruneTurnPorts,
         ShouldPresumeWritableWhenFullyRelayed = self.ShouldPresumeWritableWhenFullyRelayed,
         IceCheckMinInterval = self.IceCheckMinInterval.HasValue
             ? new NSNumber(self.IceCheckMinInterval.Value)
             :  null,
         DisableIPV6OnWiFi = self.DisableIPv6OnWiFi,
         MaxIPv6Networks = self.MaxIPv6Networks,
         DisableIPV6 = self.DisableIPv6,
         SdpSemantics = self.SdpSemantics.ToNative(),
         ActiveResetSrtpParams = self.ActiveResetSrtpParams,
         UseMediaTransport = self.UseMediaTransport,
         UseMediaTransportForDataChannels = self.UseMediaTransportForDataChannels,
         //EnableDtlsSrtp = self.EnableDtlsSrtp.HasValue ? new Boolean(self.EnableDtlsSrtp.Value) : null,
         Certificate = self.Certificate?.ToNative()
     });
 }
 public PeerConnectionNative(RTCPeerConnection peerConnection, Abstraction.RTCConfiguration configuration,
                             IPeerConnectionFactory factory, IRTCPeerConnectionDelegate peerConnectionDelegate) : base(peerConnection)
 {
     _peerConnection         = peerConnection;
     _peerConnectionDelegate = peerConnectionDelegate;
     Configuration           = configuration;
     PeerConnectionFactory   = factory;
 }
Exemple #3
0
        public bool SetConfiguration(Abstraction.RTCConfiguration configuration)
        {
            var result = _peerConnection.SetConfiguration(configuration.ToNative());

            if (result)
            {
                Configuration = configuration;
            }
            return(result);
        }
        public IPeerConnection CreatePeerConnection(Abstraction.RTCConfiguration configuration,
                                                    IPeerConnectionListener peerConnectionListener)
        {
            var rtcConfiguration = configuration.ToNative();
            var constraints      = new RTCMediaConstraints(null,
                                                           new NSDictionary <NSString, NSString>(new NSString("DtlsSrtpKeyAgreement"),
                                                                                                 new NSString(configuration.EnableDtlsSrtp ? "false" : "true")));

            var peerConnectionDelegate = new PeerConnectionListenerProxy(peerConnectionListener);

            var peerConnection = _factory.PeerConnectionWithConfiguration(rtcConfiguration, constraints,
                                                                          peerConnectionDelegate);

            return(peerConnection == null ? null : new PeerConnectionNative(peerConnection, configuration, this, peerConnectionDelegate));
        }
Exemple #5
0
 public PeerConnectionNative(RTCPeerConnection peerConnection, Abstraction.RTCConfiguration configuration, IPeerConnectionFactory factory)
 {
     _peerConnection       = peerConnection;
     Configuration         = configuration;
     PeerConnectionFactory = factory;
 }