How to capture disconnection of a peer
Hi,
I am trying to capture the case when one of the peer left the call. I have successfully started a call between Hololens 2 and unity editor. Video and audio streaming for both parts are also ok. Now, I want to manage call sessions and for that I need an event that is triggered when a peer left the call, so that I can give feedback to the other peer. I have searched through the codes but could not find such an event in the Microsoft.MixedReality.WebRTC.Unity library. Am I missing something or do I need to create such a event myself? I would be appreciated for any help. Thanks in advance.
Did you try PeerConnection.IceStateChanged? I think that this is the proper way, although I have to admit I am not 100% sure. We're exposing the underlying native API on that one and I never really understood fully the closing sequence of WebRTC at the protocol level (because that version of Google's API is not 100% conformant to the standard).
PeerConnection.IceStateChanged worked as expected. Thanks