Example #1
0
        private void Awake()
        {
            peerConnectionSource = new RTCPeerConnectionSource();
            client = GetComponentInParent <RoomClient>();
            peerUuidToConnection = new Dictionary <string, VoipPeerConnection>();
            OnPeerConnection.SetExisting(peerUuidToConnection.Values);

            audioSource = CreateAudioSource();
            audioSource.StartAudio();
        }
Example #2
0
        public void Setup(NetworkId objectId, string peerUuid,
                          bool polite, VoipMicrophoneInput source, VoipAudioSourceOutput sink,
                          Task <RTCPeerConnection> peerConnectionTask)
        {
            if (setupTask != null)
            {
                // Already setup or setup in progress
                return;
            }

            this.Id          = objectId;
            this.PeerUuid    = peerUuid;
            this.audioSource = source;
            this.audioSink   = sink;
            this.context     = NetworkScene.Register(this);

            this.setupTask = Task.Run(() => DoSetup(polite, peerConnectionTask));
        }