react-native-visit-rn-sdk 2.0.12 → 5.0.1

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