From 29990765e722e15c3947e336dd6273635fe02352 Mon Sep 17 00:00:00 2001 From: Evgeny Poberezkin <2769109+epoberezkin@users.noreply.github.com> Date: Sat, 7 May 2022 06:40:46 +0100 Subject: [PATCH] mobile: webrtc calls state machine (#606) * mobile: webrtc calls state machine * android: call api types * android: call api methods * ios: connect calls via chat UI (WIP) * ios: webrtc call connects via UI * core: update call duration/status when x.call.end is received * improve call UX/UI * audio calls * different overlay for audio calls * toggle video/audio in the call --- .../android/app/src/main/assets/www/call.html | 4 +- apps/android/app/src/main/assets/www/call.js | 73 +++--- .../android/app/src/main/assets/www/style.css | 1 + .../java/chat/simplex/app/model/SimpleXAPI.kt | 82 ++++++ .../chat/simplex/app/views/call/WebRTC.kt | 66 +++++ apps/ios/Shared/Model/ChatModel.swift | 5 + apps/ios/Shared/Model/NtfManager.swift | 51 +++- apps/ios/Shared/Model/Shared/APITypes.swift | 55 +++- apps/ios/Shared/Model/Shared/CallTypes.swift | 48 ++++ apps/ios/Shared/Model/Shared/ChatTypes.swift | 39 ++- .../Shared/Model/Shared/Notifications.swift | 11 + apps/ios/Shared/Model/SimpleXAPI.swift | 76 +++++- .../Shared/Views/Call/ActiveCallView.swift | 188 ++++++++++++++ apps/ios/Shared/Views/Call/CallView.swift | 183 -------------- apps/ios/Shared/Views/Call/WebRTC.swift | 239 +++++++++++++----- apps/ios/Shared/Views/Call/WebRTCView.swift | 169 +++++++++++++ apps/ios/Shared/Views/Chat/ChatItemView.swift | 2 + apps/ios/Shared/Views/Chat/ChatView.swift | 33 ++- .../Views/ChatList/ChatListNavLink.swift | 10 +- .../Shared/Views/ChatList/ChatListView.swift | 49 +++- .../Views/UserSettings/SettingsView.swift | 10 +- apps/ios/SimpleX.xcodeproj/project.pbxproj | 18 +- packages/simplex-chat-webrtc/src/call.html | 4 +- packages/simplex-chat-webrtc/src/call.ts | 99 +++++--- packages/simplex-chat-webrtc/src/style.css | 1 + src/Simplex/Chat.hs | 21 +- 26 files changed, 1175 insertions(+), 362 deletions(-) create mode 100644 apps/android/app/src/main/java/chat/simplex/app/views/call/WebRTC.kt create mode 100644 apps/ios/Shared/Model/Shared/CallTypes.swift create mode 100644 apps/ios/Shared/Views/Call/ActiveCallView.swift delete mode 100644 apps/ios/Shared/Views/Call/CallView.swift create mode 100644 apps/ios/Shared/Views/Call/WebRTCView.swift diff --git a/apps/android/app/src/main/assets/www/call.html b/apps/android/app/src/main/assets/www/call.html index ebe63e1a3..fd3019e8e 100644 --- a/apps/android/app/src/main/assets/www/call.html +++ b/apps/android/app/src/main/assets/www/call.html @@ -4,8 +4,8 @@ - - + +