예제 #1
0
 private void StopLocalMedia()
 {
     LocalMedia.Stop((error) =>
     {
         if (error != null)
         {
             Alert(error);
         }
     });
     LocalMedia = null;
 }
        public void StopLocalMedia()
        {
            if (this.localMedia == null)
            {
                return;
            }

            this.localMedia.Stop((error) =>
            {
                if (error != null)
                {
                    Debug.WriteLine("StopLocalMedia method: " + error);
                }
            });
            this.localMedia = null;
            this.sessionId  = null;
        }
예제 #3
0
        private void StartLocalMedia()
        {
            LocalMediaStarted = true;

            LocalMedia = new LocalMedia();
            LocalMedia.Start(VideoContainer, (error) =>
            {
                if (error != null)
                {
                    Alert(error);
                }
                else
                {
                    StartConference();
                }
            });
        }
        /// <summary>
        /// Starts the local media.
        /// </summary>
        /// <returns>The local media.</returns>
        /// <param name="callback">Callback.</param>
        public void StartLocalMedia(Action <string> callback)
        {
            Debug.WriteLine("StartLocalMedia method");

            if (videoContainer == null)
            {
                throw new ArgumentNullException(nameof(videoContainer));
            }

            if (this.localMedia != null)
            {
                return;
            }

            this.localMedia = new LocalMedia()
            {
                Video = isVideoCall
            };
            this.localMedia.Start(videoContainer, callback);
        }
        public ConferenceWrapper(string sessionId,
                                 LocalMedia localMedia)
        {
            this.LocalMedia = localMedia;
            InitAudioAndVideoStreams();

            // Create a conference using our stream descriptions.
            conference = new FM.IceLink.Conference(this.IceServers, new Stream[] { audioStream, videoStream });

            // Use our pre-generated DTLS certificate.
            conference.DtlsCertificate = Certificate;

            // Supply TURN relay credentials in case we are behind a
            // highly restrictive firewall. These credentials will be
            // verified by the TURN server.
            conference.RelayUsername = "******";
            conference.RelayPassword = "******";
            conference.ServerPort    = 3478;

            // Add a few event handlers to the conference so we can see
            // when a new P2P link is created or changes state.
            conference.OnLinkInit += LogLinkInit;
            conference.OnLinkUp   += LogLinkUp;
            conference.OnLinkDown += LogLinkDown;

            conference.OnLinkOfferAnswer += OnLinkSendOfferAnswer;
            conference.OnLinkCandidate   += OnLinkSendCandidate;
            conference.Timeout            = ConferenceTimeout;

#if __ANDROID__
            // Start echo canceller.
            OpusEchoCanceller = new OpusEchoCanceller(OpusClockRate, OpusChannels);
            OpusEchoCanceller.Start();
#endif

            this.sessionId = sessionId;
        }