Example #1
0
 public static RTCConfiguration ToPlatformNative(this Core.RTCConfiguration nativePort) => new RTCConfiguration
 {
     IceTransportPolicy              = nativePort.IceTransportPolicy.ToPlatformNative(),
     BundlePolicy                    = nativePort.BundlePolicy.ToPlatformNative(),
     RtcpMuxPolicy                   = nativePort.RtcpMuxPolicy.ToPlatformNative(),
     TcpCandidatePolicy              = nativePort.TcpCandidatePolicy.ToPlatformNative(),
     CandidateNetworkPolicy          = nativePort.CandidateNetworkPolicy.ToPlatformNative(),
     AudioJitterBufferMaxPackets     = nativePort.AudioJitterBufferMaxPackets,
     AudioJitterBufferFastAccelerate = nativePort.AudioJitterBufferFastAccelerate,
     IceConnectionReceivingTimeout   = nativePort.IceConnectionReceivingTimeout,
     KeyType = nativePort.KeyType.ToPlatformNative(),
     ContinualGatheringPolicy = nativePort.ContinualGatheringPolicy.ToPlatformNative(),
     IceCandidatePoolSize     = nativePort.IceCandidatePoolSize,
     ShouldPruneTurnPorts     = nativePort.ShouldPruneTurnPorts,
     ShouldPresumeWritableWhenFullyRelayed = nativePort.ShouldPresumeWritableWhenFullyRelayed,
     IceCheckMinInterval   = nativePort.IceCheckMinInterval.HasValue ? new NSNumber(nativePort.IceCheckMinInterval.Value) : null,
     DisableIPV6OnWiFi     = nativePort.DisableIPV6OnWiFi,
     MaxIPv6Networks       = nativePort.MaxIPv6Networks,
     DisableIPV6           = nativePort.DisableIPV6,
     SdpSemantics          = nativePort.SdpSemantics.ToPlatformNative(),
     ActiveResetSrtpParams = nativePort.ActiveResetSrtpParams,
     Certificate           = nativePort.Certificate?.ToPlatformNative(),
     IceBackupCandidatePairPingInterval = nativePort.IceBackupCandidatePairPingInterval,
     AllowCodecSwitching = nativePort.AllowCodecSwitching,
     EnableDscp          = nativePort.EnableDscp,
     IceServers          = nativePort.IceServers.ToPlatformNative().ToArray(),
 };
        public IPeerConnection PeerConnectionWithConfiguration(Core.RTCConfiguration configuration, MediaConstraints constraints, IPeerConnectionDelegate peerConnectionDelegate)
        {
            var _configuration = configuration.ToPlatformNative();
            var _constraints   = new RTCMediaConstraints(null,
                                                         new NSDictionary <NSString, NSString>(new NSString("DtlsSrtpKeyAgreement"),
                                                                                               new NSString(configuration.EnableDtlsSrtp ? "false" : "true")));
            var _peerConnection = _peerConnectionFactory.PeerConnectionWithConfiguration(_configuration, _constraints, new PlatformPeerConnectionDelegate(peerConnectionDelegate));

            return(_peerConnection == null ? null : new PlatformPeerConnection(_peerConnection, configuration, this));
        }
Example #3
0
        public IPeerConnection PeerConnectionWithConfiguration(Core.RTCConfiguration configuration, Core.MediaConstraints constraints, IPeerConnectionDelegate peerConnectionDelegate)
        {
            var _configuration  = configuration.ToPlatformNative();
            var _constraints    = constraints.ToPlatformNative();
            var _peerConnection = _peerConnectionfactory.CreatePeerConnection(_configuration, new PlatformPeerConnectionDelegate(peerConnectionDelegate));

            if (_peerConnection == null)
            {
                return(null);
            }
            return(new PlatformPeerConnection(_peerConnection, configuration, this));
        }
Example #4
0
 public bool SetConfiguration(Core.RTCConfiguration configuration) => _peerConnection.SetConfiguration(config: configuration.ToPlatformNative());
Example #5
0
 public PlatformPeerConnection(PeerConnection peerConnection, Core.RTCConfiguration configuration, PlatformPeerConnectionFactory platformPeerConnectionFactory) : base(peerConnection)
 {
     _peerConnection       = peerConnection;
     Configuration         = configuration;
     PeerConnectionFactory = platformPeerConnectionFactory;
 }
 public PlatformPeerConnection(RTCPeerConnection peerConnection, Core.RTCConfiguration configuration, IPeerConnectionFactory peerConnectionFactory)
 {
     _peerConnection       = peerConnection;
     Configuration         = configuration;
     PeerConnectionFactory = peerConnectionFactory;
 }