openwebrtc-examples
openwebrtc-examples copied to clipboard
Peer terminate call event by WebRTC on iOS
I have run ios/NativeDemo project on my iPhone, and it worked perfectly. However, I find that when my WebRTC peer taps 'Hangup' button to terminate the call, I will be noticed this thing by EventSource, not WebRTC itself. In Javascript, we have WebRTC disconnect event to know when the peer disconnects like below.
pc.oniceconnectionstatechange = function() {
if(pc.iceConnectionState == 'disconnected') {
console.log('Disconnected');
}
}
So, I think there should be a way to implement it like Javascript.
There is an ice-connection-state property on OwrSession. It may get split into connection-state and gathering-state soon as in ORTC as that is more agnostic to the connection establishment protocols used.