microsoft / MixedReality-WebRTC

MixedReality-WebRTC is a collection of components to help mixed reality app developers integrate audio and video real-time communication into their application and improve their collaborative experience
https://microsoft.github.io/MixedReality-WebRTC/
MIT License
898 stars 278 forks source link

PeerConnection state change event #792

Open wenjunche opened 2 years ago

wenjunche commented 2 years ago

Hello

I can't seem to find state change event for PeerConnection class (equivalent to RTCPeerConnection.onconnectionstatechange for javascript API). I want to detect when a PeerConnection disconnects. Am I missing something ?

Thanks

spacecheeserocks commented 2 years ago

I believe you want the IceStateChanged event (note: not IceGatheringStateChanged).

If you're using the Unity library, if there's no equivalent event exposed, you'll want to access the NativePeer property to get this underlying PeerConnection object.