Bind call buttons and set ringing timeout
- Accept call with or without video
- Ringing / connection timeout
- Close camera when call ends
- Display incoming call type (audio vs video)
GitLab: #154
GitLab: #165
GitLab: #168
Change-Id: I93ba7148941656b5bebd3ca38898bce0d4db41ca
diff --git a/client/src/contexts/WebRtcProvider.tsx b/client/src/contexts/WebRtcProvider.tsx
index f87e1ff..f1c9add 100644
--- a/client/src/contexts/WebRtcProvider.tsx
+++ b/client/src/contexts/WebRtcProvider.tsx
@@ -175,20 +175,20 @@
setRemoteStreams(event.streams);
};
- const connectionStateChangeEventListener = () => {
+ const iceConnectionStateChangeEventListener = () => {
setIsConnected(
- webRtcConnection.iceConnectionState === 'completed' || webRtcConnection.iceConnectionState === 'connected'
+ webRtcConnection.iceConnectionState === 'connected' || webRtcConnection.iceConnectionState === 'completed'
);
};
webRtcConnection.addEventListener('icecandidate', iceCandidateEventListener);
webRtcConnection.addEventListener('track', trackEventListener);
- webRtcConnection.addEventListener('iceconnectionstatechange', connectionStateChangeEventListener);
+ webRtcConnection.addEventListener('iceconnectionstatechange', iceConnectionStateChangeEventListener);
return () => {
webRtcConnection.removeEventListener('icecandidate', iceCandidateEventListener);
webRtcConnection.removeEventListener('track', trackEventListener);
- webRtcConnection.removeEventListener('iceconnectionstatechange', connectionStateChangeEventListener);
+ webRtcConnection.removeEventListener('iceconnectionstatechange', iceConnectionStateChangeEventListener);
};
}, [webRtcConnection, webSocket, contactUri]);