void OnDisable() { if (this.m_signaling != null) { this.m_signaling.Stop(); this.m_signaling = null; } }
void OnEnable() { if (this.m_signaling == null) { this.m_signaling = new AyameSignaling(urlSignaling, signalingKey, roomId, interval); this.m_signaling.OnAccept += OnAccept; this.m_signaling.OnAnswer += OnAnswer; this.m_signaling.OnOffer += OnOffer; this.m_signaling.OnIceCandidate += OnIceCandidate; } this.m_signaling.Start(); }
void OnAccept(AyameSignaling ayameSignaling) { AcceptMessage acceptMessage = ayameSignaling.m_acceptMessage; bool shouldSendOffer = acceptMessage.isExistClient; var configuration = GetSelectedSdpSemantics(); this.iceServers = configuration.iceServers; m_conf.iceServers = this.iceServers; // wait Offer if (!shouldSendOffer) { return; } // TODO: Send Offer }