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);
        }
Example #2
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));
        }
 public IPeerConnection PeerConnectionWithConfiguration(RTCConfiguration configuration, MediaConstraints constraints, IPeerConnectionDelegate peerConnectionDelegate) => _peerConnectionFactory.PeerConnectionWithConfiguration(configuration, constraints, peerConnectionDelegate);
Example #4
0
 public PlatformPeerConnectionDelegate(IPeerConnectionDelegate peerConnectionDelegate)
 {
     _peerConnectionDelegate = peerConnectionDelegate;
 }
        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));
        }