MixedReality-WebRTC icon indicating copy to clipboard operation
MixedReality-WebRTC copied to clipboard

How to capture disconnection of a peer

Open esengun opened this issue 4 years ago • 2 comments

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.

esengun avatar Mar 25 '21 06:03 esengun

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).

djee-ms avatar Mar 25 '21 11:03 djee-ms

PeerConnection.IceStateChanged worked as expected. Thanks

esengun avatar May 18 '21 12:05 esengun