react-native-visit-rn-sdk 6.0.3 → 7.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (93) hide show
  1. package/README.md +288 -122
  2. package/android/build.gradle +4 -1
  3. package/android/gradle.properties +4 -4
  4. package/android/src/main/AndroidManifest.xml +11 -5
  5. package/android/src/main/AndroidManifestNew.xml +11 -5
  6. package/android/src/main/java/com/visitrnsdk/VisitFitnessModule.kt +642 -0
  7. package/android/src/main/java/com/visitrnsdk/VisitRnSdkPackage.kt +1 -1
  8. package/android/src/main/java/com/visitrnsdk/VisitSessionStorage.kt +50 -0
  9. package/ios/VisitRnSdkViewManager.h +23 -1
  10. package/ios/VisitRnSdkViewManager.m +1259 -8
  11. package/lib/commonjs/Services.js +35 -0
  12. package/lib/commonjs/Services.js.map +1 -0
  13. package/lib/commonjs/constants.js +11 -0
  14. package/lib/commonjs/constants.js.map +1 -0
  15. package/lib/commonjs/index.android.js +450 -205
  16. package/lib/commonjs/index.android.js.map +1 -1
  17. package/lib/commonjs/index.ios.js +266 -114
  18. package/lib/commonjs/index.ios.js.map +1 -1
  19. package/lib/module/Services.js +27 -0
  20. package/lib/module/Services.js.map +1 -0
  21. package/lib/module/constants.js +5 -0
  22. package/lib/module/constants.js.map +1 -0
  23. package/lib/module/index.android.js +450 -206
  24. package/lib/module/index.android.js.map +1 -1
  25. package/lib/module/index.ios.js +268 -116
  26. package/lib/module/index.ios.js.map +1 -1
  27. package/lib/typescript/Services.d.ts +3 -0
  28. package/lib/typescript/Services.d.ts.map +1 -0
  29. package/lib/typescript/constants.d.ts +6 -0
  30. package/lib/typescript/constants.d.ts.map +1 -0
  31. package/lib/typescript/index.android.d.ts +26 -3
  32. package/lib/typescript/index.android.d.ts.map +1 -1
  33. package/lib/typescript/index.ios.d.ts +20 -3
  34. package/lib/typescript/index.ios.d.ts.map +1 -1
  35. package/package.json +14 -25
  36. package/react-native-visit-rn-sdk.podspec +2 -1
  37. package/src/Services.js +37 -0
  38. package/src/constants.js +4 -0
  39. package/src/index.android.js +773 -0
  40. package/src/index.ios.js +429 -0
  41. package/android/src/main/java/com/visitrnsdk/VisitRnSdkLocationModule.kt +0 -37
  42. package/lib/commonjs/assets/video-call/connecting-lottie.gif +0 -0
  43. package/lib/commonjs/assets/video-call/end-call.png +0 -0
  44. package/lib/commonjs/assets/video-call/mic-off.png +0 -0
  45. package/lib/commonjs/assets/video-call/reconnecting.gif +0 -0
  46. package/lib/commonjs/assets/video-call/switch-camera.png +0 -0
  47. package/lib/commonjs/assets/video-call/toggle-down.png +0 -0
  48. package/lib/commonjs/assets/video-call/toggle-up.png +0 -0
  49. package/lib/commonjs/assets/video-call/video-off.png +0 -0
  50. package/lib/commonjs/components/VideoCallComponent.js +0 -1088
  51. package/lib/commonjs/components/VideoCallComponent.js.map +0 -1
  52. package/lib/commonjs/index.js +0 -6
  53. package/lib/commonjs/index.js.map +0 -1
  54. package/lib/commonjs/shims.d.js +0 -2
  55. package/lib/commonjs/shims.d.js.map +0 -1
  56. package/lib/commonjs/types.js +0 -2
  57. package/lib/commonjs/types.js.map +0 -1
  58. package/lib/module/assets/video-call/connecting-lottie.gif +0 -0
  59. package/lib/module/assets/video-call/end-call.png +0 -0
  60. package/lib/module/assets/video-call/mic-off.png +0 -0
  61. package/lib/module/assets/video-call/reconnecting.gif +0 -0
  62. package/lib/module/assets/video-call/switch-camera.png +0 -0
  63. package/lib/module/assets/video-call/toggle-down.png +0 -0
  64. package/lib/module/assets/video-call/toggle-up.png +0 -0
  65. package/lib/module/assets/video-call/video-off.png +0 -0
  66. package/lib/module/components/VideoCallComponent.js +0 -1081
  67. package/lib/module/components/VideoCallComponent.js.map +0 -1
  68. package/lib/module/index.js +0 -2
  69. package/lib/module/index.js.map +0 -1
  70. package/lib/module/shims.d.js +0 -2
  71. package/lib/module/shims.d.js.map +0 -1
  72. package/lib/module/types.js +0 -2
  73. package/lib/module/types.js.map +0 -1
  74. package/lib/typescript/components/VideoCallComponent.d.ts +0 -79
  75. package/lib/typescript/components/VideoCallComponent.d.ts.map +0 -1
  76. package/lib/typescript/index.d.ts +0 -17
  77. package/lib/typescript/index.d.ts.map +0 -1
  78. package/lib/typescript/types.d.ts +0 -24
  79. package/lib/typescript/types.d.ts.map +0 -1
  80. package/src/assets/video-call/connecting-lottie.gif +0 -0
  81. package/src/assets/video-call/end-call.png +0 -0
  82. package/src/assets/video-call/mic-off.png +0 -0
  83. package/src/assets/video-call/reconnecting.gif +0 -0
  84. package/src/assets/video-call/switch-camera.png +0 -0
  85. package/src/assets/video-call/toggle-down.png +0 -0
  86. package/src/assets/video-call/toggle-up.png +0 -0
  87. package/src/assets/video-call/video-off.png +0 -0
  88. package/src/components/VideoCallComponent.tsx +0 -1484
  89. package/src/index.android.tsx +0 -459
  90. package/src/index.ios.tsx +0 -238
  91. package/src/index.tsx +0 -25
  92. package/src/shims.d.ts +0 -49
  93. package/src/types.ts +0 -25
@@ -1,1088 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
- var _react = _interopRequireWildcard(require("react"));
8
- var _reactNative = require("react-native");
9
- var _videoReactNativeSdk = require("@twilio/video-react-native-sdk");
10
- function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
11
- function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
12
- const {
13
- width: SCREEN_WIDTH,
14
- height: SCREEN_HEIGHT
15
- } = _reactNative.Dimensions.get('screen');
16
- const LOCAL_PREVIEW_WIDTH = 120;
17
- const LOCAL_PREVIEW_HEIGHT = 180;
18
- const LOCAL_PREVIEW_SIDE_MARGIN = 16;
19
- const LOCAL_PREVIEW_MAX_BOTTOM_OFFSET = 224;
20
- const LOCAL_PREVIEW_BOTTOM_DRAG_ALLOWANCE = 56;
21
- const VIDEO_CALL_ERROR_STATUS = Object.freeze({
22
- MISSING_ROOM_NAME_OR_ACCESS_TOKEN: 'MISSING_ROOM_NAME_OR_ACCESS_TOKEN',
23
- PERMISSIONS_REQUIRED: 'PERMISSIONS_REQUIRED',
24
- PERMISSION_CHECK_FAILED: 'PERMISSION_CHECK_FAILED',
25
- INVALID_OR_EXPIRED_TOKEN: 'INVALID_OR_EXPIRED_TOKEN',
26
- CONNECT_FAILED: 'CONNECT_FAILED'
27
- });
28
- const ICONS = {
29
- mute: require('../assets/video-call/mic-off.png'),
30
- videoOff: require('../assets/video-call/video-off.png'),
31
- flip: require('../assets/video-call/switch-camera.png'),
32
- end: require('../assets/video-call/end-call.png'),
33
- connecting: require('../assets/video-call/connecting-lottie.gif'),
34
- reconnecting: require('../assets/video-call/reconnecting.gif'),
35
- toggleUp: require('../assets/video-call/toggle-up.png'),
36
- toggleDown: require('../assets/video-call/toggle-down.png')
37
- };
38
- const initialCallState = {
39
- isVisible: false,
40
- loading: false,
41
- status: 'idle',
42
- roomName: '',
43
- accessToken: '',
44
- remoteTrackSid: '',
45
- remoteTrackIdentifier: null,
46
- participantVideoEnabled: false,
47
- participantAudioEnabled: true,
48
- isMuted: false,
49
- isVideoEnabled: true,
50
- isFrontCameraEnabled: true,
51
- signalStrength: null,
52
- participantSignalStrength: null,
53
- showLowSignalStrengthMessage: false,
54
- showParticipantReconnectingScreen: false,
55
- showUserReconnectingScreen: false,
56
- showBottomBar: true,
57
- durationMins: '00',
58
- durationSecs: '00',
59
- doctorName: '',
60
- visibleDoctorName: '',
61
- userName: ''
62
- };
63
- const VideoCallComponent = /*#__PURE__*/(0, _react.forwardRef)(function VideoCallComponentInner({
64
- onCallConnected,
65
- onCallEnded,
66
- onError,
67
- onLowNetworkQuality,
68
- onStateChange,
69
- style
70
- }, ref) {
71
- const twilioVideoRef = (0, _react.useRef)(null);
72
- const durationTimerRef = (0, _react.useRef)(null);
73
- const timerRunningRef = (0, _react.useRef)(false);
74
- const reconnectingTimerRef = (0, _react.useRef)(null);
75
- const localPreviewRefreshTimeoutRef = (0, _react.useRef)(null);
76
- const localPreviewSecondRefreshTimeoutRef = (0, _react.useRef)(null);
77
- const localPreviewDrag = (0, _react.useRef)(new _reactNative.Animated.ValueXY({
78
- x: 0,
79
- y: 0
80
- })).current;
81
- const localPreviewDragOffsetRef = (0, _react.useRef)({
82
- x: 0,
83
- y: 0
84
- });
85
- const callRef = (0, _react.useRef)({
86
- roomJoined: false,
87
- unmounted: false
88
- });
89
- callRef.current.onCallEnded = onCallEnded;
90
- const [state, setState] = (0, _react.useState)(initialCallState);
91
- const [localPreviewRefreshKey, setLocalPreviewRefreshKey] = (0, _react.useState)(0);
92
- const maxHorizontalDrag = SCREEN_WIDTH - LOCAL_PREVIEW_WIDTH - LOCAL_PREVIEW_SIDE_MARGIN * 2;
93
- const maxUpwardDrag = Math.max(0, SCREEN_HEIGHT - LOCAL_PREVIEW_HEIGHT - LOCAL_PREVIEW_MAX_BOTTOM_OFFSET);
94
- const maxDownwardDrag = LOCAL_PREVIEW_BOTTOM_DRAG_ALLOWANCE;
95
- const clampDrag = (0, _react.useCallback)((value, min, max) => Math.min(Math.max(value, min), max), []);
96
- const localPreviewPanResponder = (0, _react.useRef)(_reactNative.PanResponder.create({
97
- onMoveShouldSetPanResponder: (_, gestureState) => Math.abs(gestureState.dx) > 2 || Math.abs(gestureState.dy) > 2,
98
- onPanResponderMove: (_, gestureState) => {
99
- const nextX = clampDrag(localPreviewDragOffsetRef.current.x + gestureState.dx, -maxHorizontalDrag, 0);
100
- const nextY = clampDrag(localPreviewDragOffsetRef.current.y + gestureState.dy, -maxUpwardDrag, maxDownwardDrag);
101
- localPreviewDrag.setValue({
102
- x: nextX,
103
- y: nextY
104
- });
105
- },
106
- onPanResponderRelease: (_, gestureState) => {
107
- const nextX = clampDrag(localPreviewDragOffsetRef.current.x + gestureState.dx, -maxHorizontalDrag, 0);
108
- const nextY = clampDrag(localPreviewDragOffsetRef.current.y + gestureState.dy, -maxUpwardDrag, maxDownwardDrag);
109
- localPreviewDragOffsetRef.current = {
110
- x: nextX,
111
- y: nextY
112
- };
113
- localPreviewDrag.setValue(localPreviewDragOffsetRef.current);
114
- }
115
- })).current;
116
- (0, _react.useEffect)(() => {
117
- if (_reactNative.Platform.OS === 'android' && _reactNative.UIManager.setLayoutAnimationEnabledExperimental) {
118
- _reactNative.UIManager.setLayoutAnimationEnabledExperimental(true);
119
- }
120
- }, []);
121
- const clearDurationTimer = (0, _react.useCallback)(() => {
122
- timerRunningRef.current = false;
123
- if (durationTimerRef.current) {
124
- clearInterval(durationTimerRef.current);
125
- durationTimerRef.current = null;
126
- }
127
- }, []);
128
- const clearReconnectTimer = (0, _react.useCallback)(() => {
129
- if (reconnectingTimerRef.current) {
130
- clearInterval(reconnectingTimerRef.current);
131
- reconnectingTimerRef.current = null;
132
- }
133
- }, []);
134
- const clearLocalPreviewRefreshTimers = (0, _react.useCallback)(() => {
135
- if (localPreviewRefreshTimeoutRef.current) {
136
- clearTimeout(localPreviewRefreshTimeoutRef.current);
137
- localPreviewRefreshTimeoutRef.current = null;
138
- }
139
- if (localPreviewSecondRefreshTimeoutRef.current) {
140
- clearTimeout(localPreviewSecondRefreshTimeoutRef.current);
141
- localPreviewSecondRefreshTimeoutRef.current = null;
142
- }
143
- }, []);
144
- const refreshLocalPreview = (0, _react.useCallback)(() => {
145
- setLocalPreviewRefreshKey(prev => prev + 1);
146
- }, []);
147
- const emitState = (0, _react.useCallback)(nextState => {
148
- if (onStateChange) {
149
- onStateChange(nextState);
150
- }
151
- }, [onStateChange]);
152
- const emitErrorStatus = (0, _react.useCallback)((status, error, metadata = {}) => {
153
- if (!onError) {
154
- return;
155
- }
156
- onError({
157
- status,
158
- error,
159
- metadata
160
- });
161
- }, [onError]);
162
- const updateState = (0, _react.useCallback)(updater => {
163
- setState(prev => {
164
- const next = typeof updater === 'function' ? updater(prev) : {
165
- ...prev,
166
- ...updater
167
- };
168
- emitState(next);
169
- return next;
170
- });
171
- }, [emitState]);
172
- const leaveVideo = (0, _react.useCallback)((reason, error) => {
173
- clearDurationTimer();
174
- clearReconnectTimer();
175
- clearLocalPreviewRefreshTimers();
176
- if (callRef.current.unmounted) {
177
- return;
178
- }
179
- callRef.current.roomJoined = false;
180
- setState(() => {
181
- const finalState = JSON.parse(JSON.stringify(initialCallState));
182
- emitState(finalState);
183
- return finalState;
184
- });
185
- if (onCallEnded) {
186
- onCallEnded({
187
- reason,
188
- error
189
- });
190
- }
191
- }, [clearDurationTimer, clearReconnectTimer, clearLocalPreviewRefreshTimers, emitState, onCallEnded]);
192
- const startDurationTimer = (0, _react.useCallback)(() => {
193
- timerRunningRef.current = true;
194
- if (durationTimerRef.current) {
195
- return;
196
- }
197
- durationTimerRef.current = setInterval(() => {
198
- if (!timerRunningRef.current) {
199
- return;
200
- }
201
- updateState(prev => {
202
- let secs = parseInt(prev.durationSecs, 10) + 1;
203
- let mins = parseInt(prev.durationMins, 10);
204
- if (secs >= 60) {
205
- mins += 1;
206
- secs = 0;
207
- }
208
- return {
209
- ...prev,
210
- durationMins: mins < 10 ? `0${mins}` : String(mins),
211
- durationSecs: secs < 10 ? `0${secs}` : String(secs)
212
- };
213
- });
214
- }, 1000);
215
- }, [updateState]);
216
- const checkAndroidVideoPermissions = (0, _react.useCallback)(async () => {
217
- if (_reactNative.Platform.OS !== 'android') {
218
- return true;
219
- }
220
- try {
221
- const cameraPermission = _reactNative.PermissionsAndroid.PERMISSIONS.CAMERA;
222
- const micPermission = _reactNative.PermissionsAndroid.PERMISSIONS.RECORD_AUDIO;
223
- const hasCamera = await _reactNative.PermissionsAndroid.check(cameraPermission);
224
- const hasMic = await _reactNative.PermissionsAndroid.check(micPermission);
225
- if (hasCamera && hasMic) {
226
- return true;
227
- }
228
- const permissionResults = await _reactNative.PermissionsAndroid.requestMultiple([cameraPermission, micPermission]);
229
- const isCameraGranted = permissionResults[cameraPermission] === _reactNative.PermissionsAndroid.RESULTS.GRANTED;
230
- const isMicGranted = permissionResults[micPermission] === _reactNative.PermissionsAndroid.RESULTS.GRANTED;
231
- if (isCameraGranted && isMicGranted) {
232
- return true;
233
- }
234
- const missing = [];
235
- if (!isCameraGranted) {
236
- missing.push('camera');
237
- }
238
- if (!isMicGranted) {
239
- missing.push('microphone');
240
- }
241
- _reactNative.Alert.alert('Permissions required', `Please allow ${missing.join(' and ')} access to start a video call. You can enable this in Settings.`, [{
242
- text: 'Cancel',
243
- style: 'cancel'
244
- }, {
245
- text: 'Open Settings',
246
- onPress: () => _reactNative.Linking.openSettings()
247
- }]);
248
- emitErrorStatus(VIDEO_CALL_ERROR_STATUS.PERMISSIONS_REQUIRED, new Error('Camera and microphone permissions are required to start a video call.'));
249
- return false;
250
- } catch (error) {
251
- _reactNative.Alert.alert('Permission error', 'Unable to check camera and microphone permissions. Please try again or open Settings to grant access.', [{
252
- text: 'Cancel',
253
- style: 'cancel'
254
- }, {
255
- text: 'Open Settings',
256
- onPress: () => _reactNative.Linking.openSettings()
257
- }]);
258
- emitErrorStatus(VIDEO_CALL_ERROR_STATUS.PERMISSION_CHECK_FAILED, error, {
259
- message: 'Unable to check camera and microphone permissions.'
260
- });
261
- return false;
262
- }
263
- }, [emitErrorStatus]);
264
- const connectToRoom = (0, _react.useCallback)(async ({
265
- roomName,
266
- accessToken,
267
- doctorName,
268
- visibleDoctorName,
269
- userName
270
- }) => {
271
- if (!roomName || !accessToken) {
272
- const err = new Error('roomName and accessToken are required');
273
- emitErrorStatus(VIDEO_CALL_ERROR_STATUS.MISSING_ROOM_NAME_OR_ACCESS_TOKEN, err);
274
- return;
275
- }
276
- const canStartCall = await checkAndroidVideoPermissions();
277
- if (!canStartCall) {
278
- return;
279
- }
280
- callRef.current.roomJoined = false;
281
- callRef.current.unmounted = false;
282
- localPreviewDragOffsetRef.current = {
283
- x: 0,
284
- y: 0
285
- };
286
- localPreviewDrag.setValue({
287
- x: 0,
288
- y: 0
289
- });
290
- refreshLocalPreview();
291
- const visible = visibleDoctorName != null && visibleDoctorName !== '' ? visibleDoctorName : doctorName || '';
292
- updateState(prev => ({
293
- ...prev,
294
- isVisible: true,
295
- loading: true,
296
- status: 'connecting',
297
- roomName,
298
- accessToken,
299
- doctorName: doctorName || '',
300
- visibleDoctorName: visible,
301
- userName: userName || '',
302
- durationMins: '00',
303
- durationSecs: '00'
304
- }));
305
- setTimeout(() => {
306
- var _twilioVideoRef$curre;
307
- (_twilioVideoRef$curre = twilioVideoRef.current) === null || _twilioVideoRef$curre === void 0 || _twilioVideoRef$curre.connect({
308
- accessToken,
309
- roomName,
310
- cameraType: 'front',
311
- enableNetworkQualityReporting: true
312
- });
313
- }, 600);
314
- }, [localPreviewDrag, refreshLocalPreview, checkAndroidVideoPermissions, updateState, emitErrorStatus]);
315
- const endCall = (0, _react.useCallback)(() => {
316
- var _twilioVideoRef$curre2;
317
- (_twilioVideoRef$curre2 = twilioVideoRef.current) === null || _twilioVideoRef$curre2 === void 0 || _twilioVideoRef$curre2.disconnect();
318
- leaveVideo('ended-by-user');
319
- }, [leaveVideo]);
320
- (0, _react.useImperativeHandle)(ref, () => ({
321
- startVideoCall: ({
322
- roomName,
323
- accessToken,
324
- doctorName,
325
- visibleDoctorName,
326
- userName
327
- }) => connectToRoom({
328
- roomName,
329
- accessToken,
330
- doctorName,
331
- visibleDoctorName,
332
- userName
333
- }),
334
- endCall,
335
- isConnected: () => state.isVisible
336
- }), [connectToRoom, endCall, state.isVisible]);
337
- (0, _react.useEffect)(() => {
338
- callRef.current.unmounted = false;
339
- return () => {
340
- var _twilioVideoRef$curre3;
341
- const wasJoined = callRef.current.roomJoined;
342
- callRef.current.unmounted = true;
343
- callRef.current.roomJoined = false;
344
- clearDurationTimer();
345
- clearReconnectTimer();
346
- clearLocalPreviewRefreshTimers();
347
- // Intentionally read current refs on unmount to disconnect an active room.
348
- // eslint-disable-next-line react-hooks/exhaustive-deps
349
- (_twilioVideoRef$curre3 = twilioVideoRef.current) === null || _twilioVideoRef$curre3 === void 0 || _twilioVideoRef$curre3.disconnect();
350
- if (wasJoined) {
351
- var _callRef$current$onCa, _callRef$current;
352
- // eslint-disable-next-line react-hooks/exhaustive-deps
353
- (_callRef$current$onCa = (_callRef$current = callRef.current).onCallEnded) === null || _callRef$current$onCa === void 0 || _callRef$current$onCa.call(_callRef$current, {
354
- reason: 'component-unmount'
355
- });
356
- }
357
- };
358
- }, [clearDurationTimer, clearReconnectTimer, clearLocalPreviewRefreshTimers]);
359
- const onRoomDidConnect = ({
360
- roomName
361
- }) => {
362
- console.log('onRoomDidConnect', roomName);
363
- callRef.current.roomJoined = true;
364
- updateState(prev => ({
365
- ...prev,
366
- loading: false,
367
- status: 'connected',
368
- showUserReconnectingScreen: false
369
- }));
370
- clearReconnectTimer();
371
- if (onCallConnected) {
372
- onCallConnected({
373
- roomName
374
- });
375
- }
376
-
377
- // Twilio local preview can miss the first bind on some Android devices.
378
- // Force a couple of refresh passes right after connect.
379
- clearLocalPreviewRefreshTimers();
380
- refreshLocalPreview();
381
- localPreviewRefreshTimeoutRef.current = setTimeout(() => {
382
- var _twilioVideoRef$curre4;
383
- (_twilioVideoRef$curre4 = twilioVideoRef.current) === null || _twilioVideoRef$curre4 === void 0 || _twilioVideoRef$curre4.setLocalVideoEnabled(true);
384
- refreshLocalPreview();
385
- }, 220);
386
- localPreviewSecondRefreshTimeoutRef.current = setTimeout(() => {
387
- refreshLocalPreview();
388
- }, 700);
389
- };
390
- const onRoomDidDisconnect = ({
391
- error
392
- }) => {
393
- leaveVideo('room-disconnected', error);
394
- };
395
- const onRoomDidFailToConnect = error => {
396
- var _errorMessage$toLower;
397
- const errorMessage = String((error === null || error === void 0 ? void 0 : error.error) || (error === null || error === void 0 ? void 0 : error.message) || '');
398
- const hasTokenError = errorMessage === null || errorMessage === void 0 || (_errorMessage$toLower = errorMessage.toLowerCase()) === null || _errorMessage$toLower === void 0 ? void 0 : _errorMessage$toLower.includes('token');
399
- if (hasTokenError) {
400
- _reactNative.Alert.alert('Unable to join call', 'Your video session token is invalid or has expired.', [{
401
- text: 'OK'
402
- }]);
403
- emitErrorStatus(VIDEO_CALL_ERROR_STATUS.INVALID_OR_EXPIRED_TOKEN, error);
404
- leaveVideo('connect-failed', error);
405
- return;
406
- }
407
- emitErrorStatus(VIDEO_CALL_ERROR_STATUS.CONNECT_FAILED, error);
408
- leaveVideo('connect-failed', error);
409
- };
410
- const onParticipantAddedVideoTrack = ({
411
- participant,
412
- track
413
- }) => {
414
- updateState(prev => {
415
- if (prev.remoteTrackSid) {
416
- return prev;
417
- }
418
- return {
419
- ...prev,
420
- remoteTrackSid: (track === null || track === void 0 ? void 0 : track.trackSid) ?? '',
421
- remoteTrackIdentifier: {
422
- participantSid: (participant === null || participant === void 0 ? void 0 : participant.sid) ?? '',
423
- videoTrackSid: (track === null || track === void 0 ? void 0 : track.trackSid) ?? ''
424
- },
425
- participantVideoEnabled: !!(track !== null && track !== void 0 && track.enabled),
426
- loading: false,
427
- status: 'connected'
428
- };
429
- });
430
- startDurationTimer();
431
- };
432
- const onParticipantRemovedVideoTrack = ({
433
- track
434
- }) => {
435
- updateState(prev => {
436
- if ((track === null || track === void 0 ? void 0 : track.trackSid) !== prev.remoteTrackSid) {
437
- return prev;
438
- }
439
- timerRunningRef.current = false;
440
- return {
441
- ...prev,
442
- remoteTrackSid: '',
443
- remoteTrackIdentifier: null,
444
- status: 'participantDisconnected'
445
- };
446
- });
447
- };
448
- const onParticipantDisabledVideoTrack = event => {
449
- updateState(prev => {
450
- var _event$track;
451
- return {
452
- ...prev,
453
- participantVideoEnabled: !!((_event$track = event.track) !== null && _event$track !== void 0 && _event$track.enabled)
454
- };
455
- });
456
- };
457
- const onParticipantEnabledVideoTrack = event => {
458
- updateState(prev => {
459
- var _event$track2;
460
- return {
461
- ...prev,
462
- participantVideoEnabled: !!((_event$track2 = event.track) !== null && _event$track2 !== void 0 && _event$track2.enabled)
463
- };
464
- });
465
- };
466
- const onParticipantAudioToggled = event => {
467
- updateState(prev => {
468
- var _event$track3;
469
- return {
470
- ...prev,
471
- participantAudioEnabled: !!((_event$track3 = event.track) !== null && _event$track3 !== void 0 && _event$track3.enabled)
472
- };
473
- });
474
- };
475
- const onNetworkQualityLevelsChanged = payload => {
476
- if (payload.isLocalUser) {
477
- const isLow = payload.quality > 0 && payload.quality < 3;
478
- updateState(prev => ({
479
- ...prev,
480
- signalStrength: payload.quality,
481
- showLowSignalStrengthMessage: isLow,
482
- showUserReconnectingScreen: false
483
- }));
484
- if (isLow && onLowNetworkQuality) {
485
- onLowNetworkQuality({
486
- quality: payload.quality,
487
- participant: 'local'
488
- });
489
- }
490
- } else {
491
- updateState(prev => ({
492
- ...prev,
493
- participantSignalStrength: payload.quality,
494
- showParticipantReconnectingScreen: payload.quality <= 1
495
- }));
496
- }
497
- };
498
- const onMuteButtonPress = () => {
499
- var _twilioVideoRef$curre5;
500
- (_twilioVideoRef$curre5 = twilioVideoRef.current) === null || _twilioVideoRef$curre5 === void 0 || _twilioVideoRef$curre5.setLocalAudioEnabled(state.isMuted).then(enabled => {
501
- updateState(prev => ({
502
- ...prev,
503
- isMuted: !enabled
504
- }));
505
- });
506
- };
507
- const onVideoToggle = () => {
508
- var _twilioVideoRef$curre6;
509
- (_twilioVideoRef$curre6 = twilioVideoRef.current) === null || _twilioVideoRef$curre6 === void 0 || _twilioVideoRef$curre6.setLocalVideoEnabled(!state.isVideoEnabled).then(enabled => {
510
- console.log('onVideoToggle', enabled);
511
- updateState(prev => ({
512
- ...prev,
513
- isVideoEnabled: enabled
514
- }));
515
- }).catch(error => {
516
- console.error('Error toggling video:', error);
517
- });
518
- };
519
- const onFlipButtonPress = () => {
520
- var _twilioVideoRef$curre7;
521
- (_twilioVideoRef$curre7 = twilioVideoRef.current) === null || _twilioVideoRef$curre7 === void 0 || _twilioVideoRef$curre7.flipCamera();
522
- updateState(prev => ({
523
- ...prev,
524
- isFrontCameraEnabled: !prev.isFrontCameraEnabled
525
- }));
526
- };
527
- const onRoomReconnectingWithError = () => {
528
- updateState(prev => ({
529
- ...prev,
530
- showUserReconnectingScreen: true
531
- }));
532
- clearReconnectTimer();
533
- reconnectingTimerRef.current = setInterval(() => {
534
- var _twilioVideoRef$curre8;
535
- const {
536
- accessToken,
537
- roomName,
538
- isMuted,
539
- isVideoEnabled
540
- } = state;
541
- if (!accessToken || !roomName) {
542
- return;
543
- }
544
- (_twilioVideoRef$curre8 = twilioVideoRef.current) === null || _twilioVideoRef$curre8 === void 0 || _twilioVideoRef$curre8.connect({
545
- accessToken,
546
- roomName,
547
- enableAudio: !isMuted,
548
- enableVideo: isVideoEnabled,
549
- enableNetworkQualityReporting: true
550
- });
551
- }, 3000);
552
- };
553
- if (!state.isVisible) {
554
- return /*#__PURE__*/_react.default.createElement(_videoReactNativeSdk.TwilioVideo, {
555
- ref: twilioVideoRef,
556
- onRoomDidConnect: onRoomDidConnect,
557
- onRoomDidDisconnect: onRoomDidDisconnect,
558
- onRoomDidFailToConnect: onRoomDidFailToConnect,
559
- onParticipantAddedVideoTrack: onParticipantAddedVideoTrack,
560
- onParticipantDisabledVideoTrack: onParticipantDisabledVideoTrack,
561
- onParticipantEnabledVideoTrack: onParticipantEnabledVideoTrack,
562
- onParticipantRemovedVideoTrack: onParticipantRemovedVideoTrack,
563
- onParticipantAddedAudioTrack: onParticipantAudioToggled,
564
- onParticipantEnabledAudioTrack: onParticipantAudioToggled,
565
- onParticipantDisabledAudioTrack: onParticipantAudioToggled,
566
- onNetworkQualityLevelsChanged: onNetworkQualityLevelsChanged,
567
- onRoomReconnectingWithError: onRoomReconnectingWithError,
568
- onRoomParticipantIsReconnecting: () => updateState(prev => ({
569
- ...prev,
570
- showParticipantReconnectingScreen: true
571
- })),
572
- onRoomParticipantReconnected: () => updateState(prev => ({
573
- ...prev,
574
- showParticipantReconnectingScreen: false
575
- }))
576
- });
577
- }
578
- const isReconnecting = state.showParticipantReconnectingScreen || state.showUserReconnectingScreen;
579
- const isConnecting = state.loading || state.status === 'connecting';
580
- const showDoctorInitial = state.status === 'participantDisconnected' || !isReconnecting && !isConnecting;
581
- return /*#__PURE__*/_react.default.createElement(_reactNative.View, {
582
- style: [styles.container, style]
583
- }, /*#__PURE__*/_react.default.createElement(_reactNative.StatusBar, {
584
- barStyle: "light-content"
585
- }), /*#__PURE__*/_react.default.createElement(_reactNative.View, {
586
- style: styles.topHeader
587
- }, /*#__PURE__*/_react.default.createElement(_reactNative.View, {
588
- style: styles.headerTitleWrap
589
- }, /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
590
- style: styles.nameText
591
- }, state.doctorName || 'Doctor'), /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
592
- style: styles.timerText
593
- }, state.durationMins, ":", state.durationSecs)), (state.signalStrength !== null || state.participantSignalStrength !== null) && /*#__PURE__*/_react.default.createElement(_reactNative.View, {
594
- style: styles.signalHeaderRow
595
- }, state.participantSignalStrength !== null ? /*#__PURE__*/_react.default.createElement(SignalStrengthIndicator, {
596
- strength: state.participantSignalStrength,
597
- participantLabel: "Doctor"
598
- }) : null, state.signalStrength !== null ? /*#__PURE__*/_react.default.createElement(_reactNative.View, {
599
- style: styles.signalItemSpacer
600
- }, /*#__PURE__*/_react.default.createElement(SignalStrengthIndicator, {
601
- strength: state.signalStrength,
602
- participantLabel: "Patient"
603
- })) : null)), state.remoteTrackIdentifier && state.participantVideoEnabled && !state.showParticipantReconnectingScreen && !state.showUserReconnectingScreen ? /*#__PURE__*/_react.default.createElement(_videoReactNativeSdk.TwilioVideoParticipantView, {
604
- style: styles.remoteVideo,
605
- key: state === null || state === void 0 ? void 0 : state.remoteTrackSid,
606
- trackIdentifier: state.remoteTrackIdentifier
607
- }) : /*#__PURE__*/_react.default.createElement(_reactNative.View, {
608
- style: styles.remotePlaceholder
609
- }, isReconnecting || isConnecting ? /*#__PURE__*/_react.default.createElement(_reactNative.View, {
610
- style: [styles.connectingView, {
611
- backgroundColor: 'rgba(164, 171, 180, 0.36)'
612
- }]
613
- }, /*#__PURE__*/_react.default.createElement(_reactNative.Image, {
614
- style: styles.connectingGif,
615
- source: isReconnecting ? ICONS.reconnecting : ICONS.connecting
616
- }), /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
617
- style: styles.connectingText
618
- }, isReconnecting ? 'Reconnecting...' : 'Connecting...')) : /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
619
- style: [styles.placeholderText, showDoctorInitial ? styles.placeholderInitialText : null]
620
- }, (state.visibleDoctorName || state.doctorName || 'Doctor').trim().charAt(0).toUpperCase())), !isConnecting ? /*#__PURE__*/_react.default.createElement(_reactNative.Animated.View, _extends({
621
- style: [styles.localPreview, state.showLowSignalStrengthMessage ? state.showBottomBar ? styles.localPreviewAboveLowSignalExpanded : styles.localPreviewAboveLowSignalCollapsed : state.showBottomBar ? styles.localPreviewAboveControls : styles.localPreviewAboveCollapsedControls, {
622
- transform: localPreviewDrag.getTranslateTransform()
623
- }]
624
- }, localPreviewPanResponder.panHandlers), /*#__PURE__*/_react.default.createElement(_reactNative.View, {
625
- style: styles.localPreviewInner
626
- }, state.isVideoEnabled ? /*#__PURE__*/_react.default.createElement(_videoReactNativeSdk.TwilioVideoLocalView, {
627
- key: `local-preview-${localPreviewRefreshKey}`,
628
- enabled: true,
629
- style: styles.localVideo
630
- }) : /*#__PURE__*/_react.default.createElement(_reactNative.View, {
631
- style: [styles.localVideo, styles.localVideoOff]
632
- }, /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
633
- style: styles.localVideoOffText
634
- }, (state.userName || 'Patient').charAt(0).toUpperCase())))) : null, !state.participantAudioEnabled && !state.showLowSignalStrengthMessage ? /*#__PURE__*/_react.default.createElement(_reactNative.View, {
635
- style: [styles.participantMicOffBadge, state.showBottomBar ? styles.participantMicOffBadgeAboveControls : styles.participantMicOffBadgeAboveCollapsed]
636
- }, /*#__PURE__*/_react.default.createElement(_reactNative.Image, {
637
- source: ICONS.mute,
638
- style: styles.participantMicOffIcon,
639
- resizeMode: "contain"
640
- })) : null, state.showLowSignalStrengthMessage ? /*#__PURE__*/_react.default.createElement(_reactNative.View, {
641
- style: [styles.lowSignalBanner, state.showBottomBar ? styles.lowSignalBannerAboveControls : styles.lowSignalBannerAboveCollapsed]
642
- }, /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
643
- style: styles.lowSignalText
644
- }, "Poor connection detected. Try moving for better signal."), /*#__PURE__*/_react.default.createElement(_reactNative.Pressable, {
645
- onPress: () => updateState(prev => ({
646
- ...prev,
647
- showLowSignalStrengthMessage: false
648
- }))
649
- }, /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
650
- style: styles.lowSignalDismiss
651
- }, "Dismiss"))) : null, /*#__PURE__*/_react.default.createElement(_reactNative.View, {
652
- style: styles.bottomBarContainer
653
- }, /*#__PURE__*/_react.default.createElement(_reactNative.View, {
654
- style: [styles.controls, !state.showBottomBar ? styles.controlsCollapsed : null]
655
- }, /*#__PURE__*/_react.default.createElement(_reactNative.TouchableOpacity, {
656
- activeOpacity: 0.8,
657
- style: styles.controlsTopLineTouch,
658
- onPress: () => {
659
- _reactNative.LayoutAnimation.configureNext(_reactNative.LayoutAnimation.Presets.easeInEaseOut);
660
- updateState(prev => ({
661
- ...prev,
662
- showBottomBar: !prev.showBottomBar
663
- }));
664
- }
665
- }, /*#__PURE__*/_react.default.createElement(_reactNative.View, {
666
- style: styles.controlsTogglePill
667
- }, /*#__PURE__*/_react.default.createElement(_reactNative.Image, {
668
- source: state.showBottomBar ? ICONS.toggleDown : ICONS.toggleUp,
669
- style: styles.controlsToggleIcon,
670
- resizeMode: "contain"
671
- }))), state.showBottomBar ? /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(ControlButton, {
672
- label: "Mute",
673
- icon: ICONS.mute,
674
- onPress: onMuteButtonPress,
675
- active: state.isMuted
676
- }), /*#__PURE__*/_react.default.createElement(ControlButton, {
677
- label: "Video on",
678
- icon: ICONS.videoOff,
679
- onPress: onVideoToggle,
680
- active: !state.isVideoEnabled
681
- }), /*#__PURE__*/_react.default.createElement(ControlButton, {
682
- label: "Flip Camera",
683
- icon: ICONS.flip,
684
- onPress: onFlipButtonPress,
685
- useTouchableOpacity: true
686
- }), /*#__PURE__*/_react.default.createElement(ControlButton, {
687
- label: "End Call",
688
- icon: ICONS.end,
689
- onPress: endCall,
690
- danger: true,
691
- iconSize: 18,
692
- useTouchableOpacity: true
693
- })) : null)), /*#__PURE__*/_react.default.createElement(_videoReactNativeSdk.TwilioVideo, {
694
- ref: twilioVideoRef,
695
- onRoomDidConnect: onRoomDidConnect,
696
- onRoomDidDisconnect: onRoomDidDisconnect,
697
- onRoomDidFailToConnect: onRoomDidFailToConnect,
698
- onParticipantAddedVideoTrack: onParticipantAddedVideoTrack,
699
- onParticipantDisabledVideoTrack: onParticipantDisabledVideoTrack,
700
- onParticipantEnabledVideoTrack: onParticipantEnabledVideoTrack,
701
- onParticipantRemovedVideoTrack: onParticipantRemovedVideoTrack,
702
- onParticipantAddedAudioTrack: onParticipantAudioToggled,
703
- onParticipantEnabledAudioTrack: onParticipantAudioToggled,
704
- onParticipantDisabledAudioTrack: onParticipantAudioToggled,
705
- onNetworkQualityLevelsChanged: onNetworkQualityLevelsChanged,
706
- onRoomReconnectingWithError: onRoomReconnectingWithError,
707
- onRoomParticipantIsReconnecting: () => updateState(prev => ({
708
- ...prev,
709
- showParticipantReconnectingScreen: true
710
- })),
711
- onRoomParticipantReconnected: () => updateState(prev => ({
712
- ...prev,
713
- showParticipantReconnectingScreen: false
714
- }))
715
- }));
716
- });
717
- const SignalStrengthIndicator = ({
718
- strength,
719
- participantLabel
720
- }) => {
721
- const bars = [1, 2, 3, 4, 5];
722
- const barColor = strength <= 1 ? '#f04d5a' : strength === 2 ? '#f48f31' : strength === 3 ? '#f9ca24' : '#5dd670';
723
- return /*#__PURE__*/_react.default.createElement(_reactNative.View, {
724
- style: styles.signalContainer
725
- }, /*#__PURE__*/_react.default.createElement(_reactNative.View, {
726
- style: styles.signalBars
727
- }, bars.map((bar, idx) => /*#__PURE__*/_react.default.createElement(_reactNative.View, {
728
- key: `bar-${bar}`,
729
- style: [styles.signalBar, {
730
- backgroundColor: strength >= bar ? barColor : '#6f6f6f',
731
- height: idx === 0 ? 2 : idx * 4,
732
- marginRight: idx === 4 ? 0 : 3
733
- }]
734
- }))), /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
735
- style: styles.signalLabel
736
- }, participantLabel));
737
- };
738
- const ControlButton = ({
739
- onPress,
740
- danger,
741
- icon,
742
- customIconText,
743
- active,
744
- iconSize,
745
- useTouchableOpacity
746
- }) => {
747
- const content = /*#__PURE__*/_react.default.createElement(_reactNative.View, {
748
- style: [styles.controlIconShell, active ? styles.controlIconShellActive : null, danger ? styles.controlButtonDanger : null]
749
- }, icon ? /*#__PURE__*/_react.default.createElement(_reactNative.Image, {
750
- source: icon,
751
- style: [styles.controlButtonIcon, iconSize ? {
752
- width: iconSize,
753
- height: iconSize
754
- } : null, active ? styles.controlButtonIconActive : null, danger ? styles.controlButtonIconDanger : null],
755
- resizeMode: "contain"
756
- }) : /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
757
- style: [styles.controlFallbackIcon, active ? styles.controlFallbackIconActive : null]
758
- }, customIconText || '?'));
759
- if (useTouchableOpacity) {
760
- return /*#__PURE__*/_react.default.createElement(_reactNative.TouchableOpacity, {
761
- style: styles.controlButton,
762
- onPress: onPress,
763
- activeOpacity: 0.65
764
- }, content);
765
- }
766
- return /*#__PURE__*/_react.default.createElement(_reactNative.Pressable, {
767
- style: styles.controlButton,
768
- onPress: onPress
769
- }, content);
770
- };
771
- const styles = _reactNative.StyleSheet.create({
772
- container: {
773
- position: 'absolute',
774
- top: 0,
775
- left: 0,
776
- right: 0,
777
- bottom: 0,
778
- zIndex: 99,
779
- backgroundColor: '#000',
780
- justifyContent: 'space-between'
781
- },
782
- topHeader: {
783
- position: 'absolute',
784
- top: 0,
785
- left: 0,
786
- right: 0,
787
- zIndex: 10,
788
- flexDirection: 'row',
789
- justifyContent: 'space-between',
790
- alignItems: 'flex-end',
791
- paddingHorizontal: 16,
792
- paddingTop: 56
793
- },
794
- headerTitleWrap: {
795
- flex: 1,
796
- paddingRight: 12
797
- },
798
- nameText: {
799
- color: '#fff',
800
- fontSize: 24,
801
- fontWeight: '700'
802
- },
803
- timerText: {
804
- color: '#fff',
805
- marginTop: 4,
806
- fontSize: 13
807
- },
808
- closeButton: {
809
- paddingVertical: 8,
810
- paddingHorizontal: 12,
811
- borderRadius: 16,
812
- backgroundColor: 'rgba(255,255,255,0.2)'
813
- },
814
- closeButtonText: {
815
- color: '#fff',
816
- fontWeight: '700'
817
- },
818
- remoteVideo: {
819
- position: 'absolute',
820
- top: 0,
821
- left: 0,
822
- right: 0,
823
- bottom: 0,
824
- width: SCREEN_WIDTH,
825
- height: SCREEN_HEIGHT
826
- },
827
- remotePlaceholder: {
828
- flex: 1,
829
- alignItems: 'center',
830
- justifyContent: 'center',
831
- paddingHorizontal: 32
832
- },
833
- placeholderText: {
834
- color: '#fff',
835
- fontSize: 18,
836
- textAlign: 'center'
837
- },
838
- placeholderInitialText: {
839
- fontSize: 40,
840
- fontWeight: '700',
841
- width: 120,
842
- height: 120,
843
- lineHeight: 120,
844
- textAlign: 'center',
845
- textAlignVertical: 'center',
846
- includeFontPadding: false,
847
- borderRadius: 60,
848
- backgroundColor: 'rgb(113, 79, 255)',
849
- overflow: 'hidden'
850
- },
851
- connectingView: {
852
- minHeight: 200,
853
- width: 271,
854
- borderRadius: 16,
855
- paddingVertical: 32,
856
- paddingHorizontal: 24,
857
- alignItems: 'center',
858
- justifyContent: 'center',
859
- alignSelf: 'center',
860
- position: 'absolute',
861
- top: 0.35 * SCREEN_HEIGHT
862
- },
863
- connectingGif: {
864
- width: 108,
865
- height: 108
866
- },
867
- connectingText: {
868
- marginTop: 14,
869
- color: '#fff',
870
- fontSize: 16,
871
- fontWeight: '600',
872
- textAlign: 'center'
873
- },
874
- localPreview: {
875
- position: 'absolute',
876
- top: 'auto',
877
- right: 16,
878
- width: LOCAL_PREVIEW_WIDTH,
879
- height: LOCAL_PREVIEW_HEIGHT,
880
- zIndex: 999
881
- },
882
- localPreviewInner: {
883
- flex: 1,
884
- backgroundColor: '#1b1b1b'
885
- },
886
- localPreviewAboveControls: {
887
- bottom: 140
888
- },
889
- localPreviewAboveCollapsedControls: {
890
- bottom: 78
891
- },
892
- localPreviewAboveLowSignalExpanded: {
893
- bottom: 224
894
- },
895
- localPreviewAboveLowSignalCollapsed: {
896
- bottom: 162
897
- },
898
- localVideo: {
899
- width: '100%',
900
- height: '100%',
901
- backgroundColor: '#1b1b1b'
902
- },
903
- localVideoOff: {
904
- alignItems: 'center',
905
- justifyContent: 'center'
906
- },
907
- localVideoOffText: {
908
- color: '#fff',
909
- fontSize: 28,
910
- fontWeight: '700',
911
- width: 60,
912
- height: 60,
913
- lineHeight: 60,
914
- textAlign: 'center',
915
- textAlignVertical: 'center',
916
- includeFontPadding: false,
917
- borderRadius: 40,
918
- backgroundColor: 'rgb(113, 79, 255)',
919
- overflow: 'hidden'
920
- },
921
- controls: {
922
- zIndex: 20,
923
- flexDirection: 'row',
924
- justifyContent: 'space-around',
925
- alignItems: 'flex-start',
926
- width: SCREEN_WIDTH,
927
- paddingHorizontal: 10,
928
- paddingBottom: 20,
929
- paddingTop: 30,
930
- marginBottom: 0,
931
- borderTopLeftRadius: 24,
932
- borderTopRightRadius: 24,
933
- borderWidth: 0.5,
934
- borderColor: 'rgba(129, 186, 255, 0.18)',
935
- backgroundColor: 'rgba(164, 171, 180, 0.36)'
936
- },
937
- controlsCollapsed: {
938
- paddingTop: 16,
939
- paddingBottom: 24
940
- },
941
- bottomBarContainer: {
942
- position: 'absolute',
943
- left: 0,
944
- right: 0,
945
- bottom: 0,
946
- zIndex: 20,
947
- alignItems: 'center',
948
- justifyContent: 'flex-end',
949
- pointerEvents: 'box-none'
950
- },
951
- controlsTopLineTouch: {
952
- position: 'absolute',
953
- top: 6,
954
- alignSelf: 'center',
955
- width: 72,
956
- height: 16,
957
- alignItems: 'center',
958
- justifyContent: 'center',
959
- zIndex: 5
960
- },
961
- controlsTogglePill: {
962
- width: 40,
963
- height: 24,
964
- borderRadius: 12,
965
- alignItems: 'center',
966
- justifyContent: 'center'
967
- },
968
- controlsToggleIcon: {
969
- width: 20,
970
- height: 20,
971
- tintColor: '#fff'
972
- },
973
- controlButton: {
974
- alignItems: 'center',
975
- width: 72
976
- },
977
- controlButtonDanger: {
978
- backgroundColor: '#f04d5a'
979
- },
980
- controlIconShell: {
981
- width: 64,
982
- height: 64,
983
- borderRadius: 32,
984
- alignItems: 'center',
985
- justifyContent: 'center',
986
- backgroundColor: 'rgba(255,255,255,0.25)'
987
- },
988
- controlIconShellActive: {
989
- backgroundColor: '#ffffff'
990
- },
991
- controlButtonIcon: {
992
- width: 30,
993
- height: 30,
994
- tintColor: '#ffffff'
995
- },
996
- controlButtonIconActive: {
997
- tintColor: 'rgba(70,70,70,0.8)'
998
- },
999
- controlButtonIconDanger: {
1000
- tintColor: '#ffffff'
1001
- },
1002
- controlFallbackIcon: {
1003
- color: '#fff',
1004
- fontSize: 28,
1005
- fontWeight: '700'
1006
- },
1007
- controlFallbackIconActive: {
1008
- color: 'rgba(70,70,70,0.8)'
1009
- },
1010
- signalHeaderRow: {
1011
- flexDirection: 'row',
1012
- alignItems: 'flex-end',
1013
- marginTop: 0
1014
- },
1015
- signalContainer: {
1016
- alignItems: 'center'
1017
- },
1018
- signalItemSpacer: {
1019
- marginLeft: 10
1020
- },
1021
- signalBars: {
1022
- flexDirection: 'row',
1023
- alignItems: 'flex-end'
1024
- },
1025
- signalBar: {
1026
- width: 3,
1027
- borderRadius: 2
1028
- },
1029
- signalLabel: {
1030
- color: '#fff',
1031
- fontSize: 10,
1032
- marginTop: 3,
1033
- textAlign: 'center',
1034
- width: '100%'
1035
- },
1036
- participantMicOffBadge: {
1037
- position: 'absolute',
1038
- alignSelf: 'center',
1039
- zIndex: 21,
1040
- width: 52,
1041
- height: 52,
1042
- alignItems: 'center',
1043
- justifyContent: 'center'
1044
- },
1045
- participantMicOffBadgeAboveControls: {
1046
- bottom: 118
1047
- },
1048
- participantMicOffBadgeAboveCollapsed: {
1049
- bottom: 58
1050
- },
1051
- participantMicOffIcon: {
1052
- width: 22,
1053
- height: 22,
1054
- tintColor: '#fff'
1055
- },
1056
- lowSignalBanner: {
1057
- position: 'absolute',
1058
- left: 16,
1059
- right: 16,
1060
- zIndex: 20,
1061
- borderRadius: 12,
1062
- backgroundColor: 'rgba(0,0,0,0.6)',
1063
- paddingHorizontal: 12,
1064
- paddingVertical: 10,
1065
- flexDirection: 'row',
1066
- alignItems: 'center',
1067
- justifyContent: 'space-between'
1068
- },
1069
- lowSignalBannerAboveControls: {
1070
- bottom: 130
1071
- },
1072
- lowSignalBannerAboveCollapsed: {
1073
- bottom: 68
1074
- },
1075
- lowSignalText: {
1076
- color: '#fff',
1077
- fontSize: 12,
1078
- flex: 1,
1079
- paddingRight: 8
1080
- },
1081
- lowSignalDismiss: {
1082
- color: '#7ec8ff',
1083
- fontWeight: '700',
1084
- fontSize: 12
1085
- }
1086
- });
1087
- var _default = exports.default = VideoCallComponent;
1088
- //# sourceMappingURL=VideoCallComponent.js.map