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