Improve permission handling in call flow
Improve permission handling by asking the user to give mic and camera permissions before sending `CallBegin` or `CallAccept` for the caller and receiver respectively.
Followed the flow described here: https://developer.mozilla.org/en-US/docs/Web/API/WebRTC_API/Connectivity#session_descriptions
CallProvider:
- Change functions order to place listeners under the function that sends the corresponding WebSocket message.
- Replace `Default` CallStatus with `Loading` for when asking user permissions before sending the `CallBegin`/`CallAccept` message.
- Remove `localStream` and `remoteStream` from `CallContext`. They are now available only in `WebRtcContext`.
- Replace `setAudioStatus` and `setVideoStatus` with `setIsAudioOn` and `setIsVideoOn`. A `useEffect` is now used to disable the tracks when the audio/video status changes.
WebRtcProvider:
- Move WebRTC connection close logic to WebRtcProvider
- Remove `webRtcConnection` from `WebRtcContext`. `WebRtcProvider` is now in charge of setting everything related to the WebRTC Connection.
UI:
- Add `CallPermissionDenied` page for when permissions are denied.
- Rework `CallPending` to display `Loading...` when waiting for user permissions
Change-Id: I48153577cca4c73cdb9b81d2fa78cfdfe2e06d69
diff --git a/client/src/locale/en/translation.json b/client/src/locale/en/translation.json
index c63ef9c..aaaa85f 100644
--- a/client/src/locale/en/translation.json
+++ b/client/src/locale/en/translation.json
@@ -72,13 +72,15 @@
"message_input_placeholder_four": "Write to {{member0}}, {{member1}}, {{member2}}, +1 other member",
"message_input_placeholder_more": "Write to {{member0}}, {{member1}}, {{member2}}, +{{excess}} other members",
"conversation_add_contact": "Add contact",
+ "loading": "Loading...",
"calling": "Calling {{member0}}",
"connecting": "Connecting...",
"end_call": "End call",
- "incoming_call_medium": "",
"refuse_call": "Refuse",
"accept_call_audio": "Accept in audio",
"accept_call_video": "Accept in video",
+ "permission_denied_title": "You denied Jami access to the camera and microphone",
+ "permission_denied_details": "You need to give Jami permission to use the camera and microphone in order to make a call",
"settings_title_general": "General",
"settings_title_system": "System",
"setting_dark_theme": "Dark theme",