示例#1
0
        private void CreatePeerConnectionInternal()
        {
            var rtcConfig = new PeerConnection.RTCConfiguration(new List <PeerConnection.IceServer>())
            {
                TcpCandidatePolicy       = PeerConnection.TcpCandidatePolicy.Disabled,
                BundlePolicy             = PeerConnection.BundlePolicy.Maxbundle,
                RtcpMuxPolicy            = PeerConnection.RtcpMuxPolicy.Require,
                ContinualGatheringPolicy = PeerConnection.ContinualGatheringPolicy.GatherContinually,
                KeyType        = PeerConnection.KeyType.Ecdsa,
                EnableDtlsSrtp = new Java.Lang.Boolean(true),
                SdpSemantics   = PeerConnection.SdpSemantics.UnifiedPlan
            };

            _peerConnection = _factory.CreatePeerConnection(rtcConfig, this);

            var mediaStreamLabels = new List <string> {
                "ARDAMS"
            };

            _peerConnection.AddTrack(CreateVideoTrack(_videoCapturer), mediaStreamLabels);
            _peerConnection.AddTrack(CreateAudioTrack(), mediaStreamLabels);
        }
示例#2
0
        public IRtpSender AddTrack(IMediaStreamTrack track, string[] streamIds)
        {
            var rtpSender = new RtpSenderNative(_peerConnection.AddTrack(track.ToNative(), streamIds));

            return(rtpSender);
        }
示例#3
0
 public IRtpSender AddTrack(IMediaStreamTrack mediaStreamTrack, string[] streamIds) => new PlatformRtpSender(_peerConnection.AddTrack(mediaStreamTrack.ToPlatformNative <MediaStreamTrack>(), streamIds));