@stream-io/video-react-native-sdk 1.22.3 → 1.24.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 (251) hide show
  1. package/CHANGELOG.md +30 -0
  2. package/android/src/main/java/com/streamvideo/reactnative/callmanager/ProximityManager.kt +183 -0
  3. package/android/src/main/java/com/streamvideo/reactnative/callmanager/StreamInCallManagerModule.kt +12 -1
  4. package/dist/commonjs/components/Call/CallContent/CallContent.js +2 -2
  5. package/dist/commonjs/components/Call/CallContent/CallContent.js.map +1 -1
  6. package/dist/commonjs/components/Call/CallContent/RTCViewPipIOS.js +2 -2
  7. package/dist/commonjs/components/Call/CallContent/RTCViewPipIOS.js.map +1 -1
  8. package/dist/commonjs/components/Call/CallContent/RTCViewPipNative.js +3 -3
  9. package/dist/commonjs/components/Call/CallContent/RTCViewPipNative.js.map +1 -1
  10. package/dist/commonjs/components/Call/CallControls/AcceptCallButton.js +3 -3
  11. package/dist/commonjs/components/Call/CallControls/AcceptCallButton.js.map +1 -1
  12. package/dist/commonjs/components/Call/CallControls/HangupCallButton.js +3 -3
  13. package/dist/commonjs/components/Call/CallControls/HangupCallButton.js.map +1 -1
  14. package/dist/commonjs/components/Call/CallControls/RejectCallButton.js +2 -2
  15. package/dist/commonjs/components/Call/CallControls/RejectCallButton.js.map +1 -1
  16. package/dist/commonjs/components/Call/CallControls/internal/ReactionsPicker.js +2 -2
  17. package/dist/commonjs/components/Call/CallControls/internal/ReactionsPicker.js.map +1 -1
  18. package/dist/commonjs/components/Call/Lobby/JoinCallButton.js +2 -2
  19. package/dist/commonjs/components/Call/Lobby/JoinCallButton.js.map +1 -1
  20. package/dist/commonjs/components/Livestream/LivestreamControls/HostStartStreamButton.js +4 -4
  21. package/dist/commonjs/components/Livestream/LivestreamControls/HostStartStreamButton.js.map +1 -1
  22. package/dist/commonjs/components/Livestream/LivestreamControls/ViewerLeaveStreamButton.js +2 -2
  23. package/dist/commonjs/components/Livestream/LivestreamControls/ViewerLeaveStreamButton.js.map +1 -1
  24. package/dist/commonjs/components/Livestream/LivestreamPlayer/LivestreamPlayer.js +4 -4
  25. package/dist/commonjs/components/Livestream/LivestreamPlayer/LivestreamPlayer.js.map +1 -1
  26. package/dist/commonjs/components/Livestream/ViewerLivestream/ViewerLobby.js +2 -2
  27. package/dist/commonjs/components/Livestream/ViewerLivestream/ViewerLobby.js.map +1 -1
  28. package/dist/commonjs/components/Participant/FloatingParticipantView/FloatingView/AnimatedFloatingView.js +2 -2
  29. package/dist/commonjs/components/Participant/FloatingParticipantView/FloatingView/AnimatedFloatingView.js.map +1 -1
  30. package/dist/commonjs/components/Participant/FloatingParticipantView/index.js +13 -6
  31. package/dist/commonjs/components/Participant/FloatingParticipantView/index.js.map +1 -1
  32. package/dist/commonjs/components/Participant/FloatingParticipantView/useFloatingVideoDimensions.js +30 -0
  33. package/dist/commonjs/components/Participant/FloatingParticipantView/useFloatingVideoDimensions.js.map +1 -0
  34. package/dist/commonjs/constants/index.js +1 -6
  35. package/dist/commonjs/constants/index.js.map +1 -1
  36. package/dist/commonjs/contexts/internal/ScreenshotIosContext.js +3 -3
  37. package/dist/commonjs/contexts/internal/ScreenshotIosContext.js.map +1 -1
  38. package/dist/commonjs/hooks/push/useInitAndroidTokenAndRest.js +1 -1
  39. package/dist/commonjs/hooks/push/useInitAndroidTokenAndRest.js.map +1 -1
  40. package/dist/commonjs/hooks/push/useIosCallkeepWithCallingStateEffect.js +2 -2
  41. package/dist/commonjs/hooks/push/useIosCallkeepWithCallingStateEffect.js.map +1 -1
  42. package/dist/commonjs/hooks/push/useIosVoipPushEventsSetupEffect.js +13 -13
  43. package/dist/commonjs/hooks/push/useIosVoipPushEventsSetupEffect.js.map +1 -1
  44. package/dist/commonjs/hooks/push/useProcessPushCallEffect.js +2 -2
  45. package/dist/commonjs/hooks/push/useProcessPushCallEffect.js.map +1 -1
  46. package/dist/commonjs/hooks/push/useProcessPushNonRingingCallEffect.js +1 -1
  47. package/dist/commonjs/hooks/push/useProcessPushNonRingingCallEffect.js.map +1 -1
  48. package/dist/commonjs/hooks/useAndroidKeepCallAliveEffect.js +10 -10
  49. package/dist/commonjs/hooks/useAndroidKeepCallAliveEffect.js.map +1 -1
  50. package/dist/commonjs/hooks/usePermissionRequest.js +2 -2
  51. package/dist/commonjs/hooks/usePermissionRequest.js.map +1 -1
  52. package/dist/commonjs/hooks/useScreenShareButton.js +4 -4
  53. package/dist/commonjs/hooks/useScreenShareButton.js.map +1 -1
  54. package/dist/commonjs/hooks/useScreenshot.js +2 -2
  55. package/dist/commonjs/hooks/useScreenshot.js.map +1 -1
  56. package/dist/commonjs/hooks/useTrackDimensions.js +1 -1
  57. package/dist/commonjs/hooks/useTrackDimensions.js.map +1 -1
  58. package/dist/commonjs/modules/call-manager/PrevLibDetection.js +1 -1
  59. package/dist/commonjs/modules/call-manager/PrevLibDetection.js.map +1 -1
  60. package/dist/commonjs/providers/BusyTonePlayer.js +6 -6
  61. package/dist/commonjs/providers/BusyTonePlayer.js.map +1 -1
  62. package/dist/commonjs/providers/NoiseCancellation/NoiseCancellationProvider.js +2 -2
  63. package/dist/commonjs/providers/NoiseCancellation/NoiseCancellationProvider.js.map +1 -1
  64. package/dist/commonjs/providers/StreamCall/AppStateListener.js +7 -7
  65. package/dist/commonjs/providers/StreamCall/AppStateListener.js.map +1 -1
  66. package/dist/commonjs/utils/getAndroidDefaultRingtoneUrl.js +3 -3
  67. package/dist/commonjs/utils/getAndroidDefaultRingtoneUrl.js.map +1 -1
  68. package/dist/commonjs/utils/push/android.js +30 -30
  69. package/dist/commonjs/utils/push/android.js.map +1 -1
  70. package/dist/commonjs/utils/push/internal/ios.js +9 -9
  71. package/dist/commonjs/utils/push/internal/ios.js.map +1 -1
  72. package/dist/commonjs/utils/push/internal/utils.js +11 -11
  73. package/dist/commonjs/utils/push/internal/utils.js.map +1 -1
  74. package/dist/commonjs/utils/push/ios.js +21 -21
  75. package/dist/commonjs/utils/push/ios.js.map +1 -1
  76. package/dist/commonjs/utils/push/libs/expoNotifications.js +1 -1
  77. package/dist/commonjs/utils/push/libs/expoNotifications.js.map +1 -1
  78. package/dist/commonjs/utils/push/libs/firebaseMessaging/index.js +3 -3
  79. package/dist/commonjs/utils/push/libs/firebaseMessaging/index.js.map +1 -1
  80. package/dist/commonjs/utils/push/libs/notifee/index.js +3 -3
  81. package/dist/commonjs/utils/push/libs/notifee/index.js.map +1 -1
  82. package/dist/commonjs/utils/push/setupIosCallKeepEvents.js +7 -7
  83. package/dist/commonjs/utils/push/setupIosCallKeepEvents.js.map +1 -1
  84. package/dist/commonjs/utils/push/setupIosVoipPushEvents.js +4 -4
  85. package/dist/commonjs/utils/push/setupIosVoipPushEvents.js.map +1 -1
  86. package/dist/commonjs/version.js +1 -1
  87. package/dist/module/components/Call/CallContent/CallContent.js +3 -3
  88. package/dist/module/components/Call/CallContent/CallContent.js.map +1 -1
  89. package/dist/module/components/Call/CallContent/RTCViewPipIOS.js +3 -3
  90. package/dist/module/components/Call/CallContent/RTCViewPipIOS.js.map +1 -1
  91. package/dist/module/components/Call/CallContent/RTCViewPipNative.js +3 -3
  92. package/dist/module/components/Call/CallContent/RTCViewPipNative.js.map +1 -1
  93. package/dist/module/components/Call/CallControls/AcceptCallButton.js +3 -3
  94. package/dist/module/components/Call/CallControls/AcceptCallButton.js.map +1 -1
  95. package/dist/module/components/Call/CallControls/HangupCallButton.js +3 -4
  96. package/dist/module/components/Call/CallControls/HangupCallButton.js.map +1 -1
  97. package/dist/module/components/Call/CallControls/RejectCallButton.js +3 -3
  98. package/dist/module/components/Call/CallControls/RejectCallButton.js.map +1 -1
  99. package/dist/module/components/Call/CallControls/internal/ReactionsPicker.js +3 -3
  100. package/dist/module/components/Call/CallControls/internal/ReactionsPicker.js.map +1 -1
  101. package/dist/module/components/Call/Lobby/JoinCallButton.js +3 -3
  102. package/dist/module/components/Call/Lobby/JoinCallButton.js.map +1 -1
  103. package/dist/module/components/Livestream/LivestreamControls/HostStartStreamButton.js +5 -5
  104. package/dist/module/components/Livestream/LivestreamControls/HostStartStreamButton.js.map +1 -1
  105. package/dist/module/components/Livestream/LivestreamControls/ViewerLeaveStreamButton.js +3 -3
  106. package/dist/module/components/Livestream/LivestreamControls/ViewerLeaveStreamButton.js.map +1 -1
  107. package/dist/module/components/Livestream/LivestreamPlayer/LivestreamPlayer.js +5 -5
  108. package/dist/module/components/Livestream/LivestreamPlayer/LivestreamPlayer.js.map +1 -1
  109. package/dist/module/components/Livestream/ViewerLivestream/ViewerLobby.js +3 -4
  110. package/dist/module/components/Livestream/ViewerLivestream/ViewerLobby.js.map +1 -1
  111. package/dist/module/components/Participant/FloatingParticipantView/FloatingView/AnimatedFloatingView.js +3 -3
  112. package/dist/module/components/Participant/FloatingParticipantView/FloatingView/AnimatedFloatingView.js.map +1 -1
  113. package/dist/module/components/Participant/FloatingParticipantView/index.js +14 -7
  114. package/dist/module/components/Participant/FloatingParticipantView/index.js.map +1 -1
  115. package/dist/module/components/Participant/FloatingParticipantView/useFloatingVideoDimensions.js +23 -0
  116. package/dist/module/components/Participant/FloatingParticipantView/useFloatingVideoDimensions.js.map +1 -0
  117. package/dist/module/constants/index.js +0 -5
  118. package/dist/module/constants/index.js.map +1 -1
  119. package/dist/module/contexts/internal/ScreenshotIosContext.js +4 -4
  120. package/dist/module/contexts/internal/ScreenshotIosContext.js.map +1 -1
  121. package/dist/module/hooks/push/useInitAndroidTokenAndRest.js +2 -2
  122. package/dist/module/hooks/push/useInitAndroidTokenAndRest.js.map +1 -1
  123. package/dist/module/hooks/push/useIosCallkeepWithCallingStateEffect.js +3 -3
  124. package/dist/module/hooks/push/useIosCallkeepWithCallingStateEffect.js.map +1 -1
  125. package/dist/module/hooks/push/useIosVoipPushEventsSetupEffect.js +14 -14
  126. package/dist/module/hooks/push/useIosVoipPushEventsSetupEffect.js.map +1 -1
  127. package/dist/module/hooks/push/useProcessPushCallEffect.js +3 -3
  128. package/dist/module/hooks/push/useProcessPushCallEffect.js.map +1 -1
  129. package/dist/module/hooks/push/useProcessPushNonRingingCallEffect.js +2 -2
  130. package/dist/module/hooks/push/useProcessPushNonRingingCallEffect.js.map +1 -1
  131. package/dist/module/hooks/useAndroidKeepCallAliveEffect.js +11 -11
  132. package/dist/module/hooks/useAndroidKeepCallAliveEffect.js.map +1 -1
  133. package/dist/module/hooks/usePermissionRequest.js +3 -3
  134. package/dist/module/hooks/usePermissionRequest.js.map +1 -1
  135. package/dist/module/hooks/useScreenShareButton.js +5 -5
  136. package/dist/module/hooks/useScreenShareButton.js.map +1 -1
  137. package/dist/module/hooks/useScreenshot.js +3 -3
  138. package/dist/module/hooks/useScreenshot.js.map +1 -1
  139. package/dist/module/hooks/useTrackDimensions.js +1 -1
  140. package/dist/module/hooks/useTrackDimensions.js.map +1 -1
  141. package/dist/module/modules/call-manager/PrevLibDetection.js +2 -2
  142. package/dist/module/modules/call-manager/PrevLibDetection.js.map +1 -1
  143. package/dist/module/providers/BusyTonePlayer.js +7 -7
  144. package/dist/module/providers/BusyTonePlayer.js.map +1 -1
  145. package/dist/module/providers/NoiseCancellation/NoiseCancellationProvider.js +3 -3
  146. package/dist/module/providers/NoiseCancellation/NoiseCancellationProvider.js.map +1 -1
  147. package/dist/module/providers/StreamCall/AppStateListener.js +8 -8
  148. package/dist/module/providers/StreamCall/AppStateListener.js.map +1 -1
  149. package/dist/module/utils/getAndroidDefaultRingtoneUrl.js +3 -3
  150. package/dist/module/utils/getAndroidDefaultRingtoneUrl.js.map +1 -1
  151. package/dist/module/utils/push/android.js +31 -31
  152. package/dist/module/utils/push/android.js.map +1 -1
  153. package/dist/module/utils/push/internal/ios.js +9 -9
  154. package/dist/module/utils/push/internal/ios.js.map +1 -1
  155. package/dist/module/utils/push/internal/utils.js +12 -12
  156. package/dist/module/utils/push/internal/utils.js.map +1 -1
  157. package/dist/module/utils/push/ios.js +22 -22
  158. package/dist/module/utils/push/ios.js.map +1 -1
  159. package/dist/module/utils/push/libs/expoNotifications.js +2 -2
  160. package/dist/module/utils/push/libs/expoNotifications.js.map +1 -1
  161. package/dist/module/utils/push/libs/firebaseMessaging/index.js +3 -3
  162. package/dist/module/utils/push/libs/firebaseMessaging/index.js.map +1 -1
  163. package/dist/module/utils/push/libs/notifee/index.js +3 -3
  164. package/dist/module/utils/push/libs/notifee/index.js.map +1 -1
  165. package/dist/module/utils/push/setupIosCallKeepEvents.js +8 -8
  166. package/dist/module/utils/push/setupIosCallKeepEvents.js.map +1 -1
  167. package/dist/module/utils/push/setupIosVoipPushEvents.js +5 -5
  168. package/dist/module/utils/push/setupIosVoipPushEvents.js.map +1 -1
  169. package/dist/module/version.js +1 -1
  170. package/dist/typescript/components/Call/CallContent/CallContent.d.ts.map +1 -1
  171. package/dist/typescript/components/Call/CallContent/RTCViewPipIOS.d.ts.map +1 -1
  172. package/dist/typescript/components/Call/CallContent/RTCViewPipNative.d.ts.map +1 -1
  173. package/dist/typescript/components/Call/CallControls/AcceptCallButton.d.ts.map +1 -1
  174. package/dist/typescript/components/Call/CallControls/HangupCallButton.d.ts.map +1 -1
  175. package/dist/typescript/components/Call/CallControls/internal/ReactionsPicker.d.ts.map +1 -1
  176. package/dist/typescript/components/Livestream/ViewerLivestream/ViewerLobby.d.ts.map +1 -1
  177. package/dist/typescript/components/Participant/FloatingParticipantView/FloatingView/AnimatedFloatingView.d.ts.map +1 -1
  178. package/dist/typescript/components/Participant/FloatingParticipantView/index.d.ts.map +1 -1
  179. package/dist/typescript/components/Participant/FloatingParticipantView/useFloatingVideoDimensions.d.ts +9 -0
  180. package/dist/typescript/components/Participant/FloatingParticipantView/useFloatingVideoDimensions.d.ts.map +1 -0
  181. package/dist/typescript/constants/index.d.ts +0 -5
  182. package/dist/typescript/constants/index.d.ts.map +1 -1
  183. package/dist/typescript/contexts/internal/ScreenshotIosContext.d.ts.map +1 -1
  184. package/dist/typescript/hooks/push/useInitAndroidTokenAndRest.d.ts.map +1 -1
  185. package/dist/typescript/hooks/push/useIosCallkeepWithCallingStateEffect.d.ts.map +1 -1
  186. package/dist/typescript/hooks/push/useIosVoipPushEventsSetupEffect.d.ts.map +1 -1
  187. package/dist/typescript/hooks/push/useProcessPushCallEffect.d.ts.map +1 -1
  188. package/dist/typescript/hooks/push/useProcessPushNonRingingCallEffect.d.ts.map +1 -1
  189. package/dist/typescript/hooks/useAndroidKeepCallAliveEffect.d.ts.map +1 -1
  190. package/dist/typescript/hooks/useScreenShareButton.d.ts.map +1 -1
  191. package/dist/typescript/hooks/useScreenshot.d.ts.map +1 -1
  192. package/dist/typescript/hooks/useTrackDimensions.d.ts +1 -1
  193. package/dist/typescript/hooks/useTrackDimensions.d.ts.map +1 -1
  194. package/dist/typescript/modules/call-manager/PrevLibDetection.d.ts.map +1 -1
  195. package/dist/typescript/providers/BusyTonePlayer.d.ts.map +1 -1
  196. package/dist/typescript/providers/NoiseCancellation/NoiseCancellationProvider.d.ts.map +1 -1
  197. package/dist/typescript/providers/StreamCall/AppStateListener.d.ts.map +1 -1
  198. package/dist/typescript/utils/push/android.d.ts.map +1 -1
  199. package/dist/typescript/utils/push/internal/ios.d.ts.map +1 -1
  200. package/dist/typescript/utils/push/internal/utils.d.ts.map +1 -1
  201. package/dist/typescript/utils/push/ios.d.ts.map +1 -1
  202. package/dist/typescript/utils/push/libs/expoNotifications.d.ts.map +1 -1
  203. package/dist/typescript/utils/push/libs/firebaseMessaging/index.d.ts.map +1 -1
  204. package/dist/typescript/utils/push/libs/notifee/index.d.ts.map +1 -1
  205. package/dist/typescript/utils/push/setupIosCallKeepEvents.d.ts.map +1 -1
  206. package/dist/typescript/utils/push/setupIosVoipPushEvents.d.ts.map +1 -1
  207. package/dist/typescript/version.d.ts +1 -1
  208. package/ios/StreamInCallManager.swift +112 -37
  209. package/package.json +3 -3
  210. package/src/components/Call/CallContent/CallContent.tsx +7 -9
  211. package/src/components/Call/CallContent/RTCViewPipIOS.tsx +7 -9
  212. package/src/components/Call/CallContent/RTCViewPipNative.tsx +8 -6
  213. package/src/components/Call/CallControls/AcceptCallButton.tsx +3 -3
  214. package/src/components/Call/CallControls/HangupCallButton.tsx +3 -4
  215. package/src/components/Call/CallControls/RejectCallButton.tsx +4 -4
  216. package/src/components/Call/CallControls/internal/ReactionsPicker.tsx +6 -3
  217. package/src/components/Call/Lobby/JoinCallButton.tsx +3 -3
  218. package/src/components/Livestream/LivestreamControls/HostStartStreamButton.tsx +5 -5
  219. package/src/components/Livestream/LivestreamControls/ViewerLeaveStreamButton.tsx +3 -3
  220. package/src/components/Livestream/LivestreamPlayer/LivestreamPlayer.tsx +5 -5
  221. package/src/components/Livestream/ViewerLivestream/ViewerLobby.tsx +3 -4
  222. package/src/components/Participant/FloatingParticipantView/FloatingView/AnimatedFloatingView.tsx +3 -4
  223. package/src/components/Participant/FloatingParticipantView/index.tsx +20 -6
  224. package/src/components/Participant/FloatingParticipantView/useFloatingVideoDimensions.tsx +36 -0
  225. package/src/constants/index.ts +0 -6
  226. package/src/contexts/internal/ScreenshotIosContext.tsx +12 -14
  227. package/src/hooks/push/useInitAndroidTokenAndRest.ts +4 -6
  228. package/src/hooks/push/useIosCallkeepWithCallingStateEffect.ts +9 -3
  229. package/src/hooks/push/useIosVoipPushEventsSetupEffect.ts +14 -19
  230. package/src/hooks/push/useProcessPushCallEffect.ts +11 -9
  231. package/src/hooks/push/useProcessPushNonRingingCallEffect.ts +6 -5
  232. package/src/hooks/useAndroidKeepCallAliveEffect.ts +17 -14
  233. package/src/hooks/usePermissionRequest.tsx +3 -3
  234. package/src/hooks/useScreenShareButton.ts +5 -7
  235. package/src/hooks/useScreenshot.ts +7 -11
  236. package/src/hooks/useTrackDimensions.ts +2 -2
  237. package/src/modules/call-manager/PrevLibDetection.ts +6 -5
  238. package/src/providers/BusyTonePlayer.tsx +7 -11
  239. package/src/providers/NoiseCancellation/NoiseCancellationProvider.tsx +7 -11
  240. package/src/providers/StreamCall/AppStateListener.tsx +8 -12
  241. package/src/utils/getAndroidDefaultRingtoneUrl.ts +3 -3
  242. package/src/utils/push/android.ts +93 -85
  243. package/src/utils/push/internal/ios.ts +9 -15
  244. package/src/utils/push/internal/utils.ts +28 -25
  245. package/src/utils/push/ios.ts +28 -32
  246. package/src/utils/push/libs/expoNotifications.ts +6 -5
  247. package/src/utils/push/libs/firebaseMessaging/index.ts +5 -4
  248. package/src/utils/push/libs/notifee/index.ts +3 -4
  249. package/src/utils/push/setupIosCallKeepEvents.ts +12 -14
  250. package/src/utils/push/setupIosVoipPushEvents.ts +7 -9
  251. package/src/version.ts +1 -1
@@ -7,7 +7,7 @@ import {
7
7
  } from '@stream-io/video-react-bindings';
8
8
  import { filter } from 'rxjs/operators';
9
9
  import { processNonIncomingCallFromPush } from '../../utils/push/internal/utils';
10
- import { getLogger } from '@stream-io/video-client';
10
+ import { videoLoggerSystem } from '@stream-io/video-client';
11
11
 
12
12
  /**
13
13
  * This hook is used to process the non ringing call data via push notifications using the relevant rxjs subject
@@ -27,10 +27,11 @@ export const useProcessPushNonRingingCallEffect = () => {
27
27
  const subscription = pushNonRingingCallData$
28
28
  .pipe(filter(NotUndefined))
29
29
  .subscribe(async ({ cid, type }) => {
30
- getLogger(['useProcessPushNonRingingCallEffect'])(
31
- 'debug',
32
- `processNonIncomingCallFromPush with callCId: ${cid} and type: ${type}`,
33
- );
30
+ videoLoggerSystem
31
+ .getLogger('useProcessPushNonRingingCallEffect')
32
+ .debug(
33
+ `processNonIncomingCallFromPush with callCId: ${cid} and type: ${type}`,
34
+ );
34
35
  await processNonIncomingCallFromPush(client, cid, type);
35
36
  pushNonRingingCallData$.next(undefined); // remove the current data to avoid processing again
36
37
  });
@@ -7,7 +7,7 @@ import {
7
7
  NativeModules,
8
8
  Platform,
9
9
  } from 'react-native';
10
- import { Call, CallingState, getLogger } from '@stream-io/video-client';
10
+ import { Call, CallingState, videoLoggerSystem } from '@stream-io/video-client';
11
11
  import {
12
12
  getKeepCallAliveForegroundServiceTypes,
13
13
  getNotifeeLibNoThrowForKeepCallAlive,
@@ -23,17 +23,20 @@ function setForegroundService() {
23
23
  NativeModules.StreamVideoReactNative.isCallAliveConfigured().then(
24
24
  (isConfigured: boolean) => {
25
25
  if (!isConfigured) {
26
- const logger = getLogger(['setForegroundService method']);
27
- logger(
28
- 'info',
26
+ const logger = videoLoggerSystem.getLogger(
27
+ 'setForegroundService method',
28
+ );
29
+ logger.info(
29
30
  'KeepCallAlive is not configured. Skipping foreground service setup.',
30
31
  );
31
32
  return;
32
33
  }
33
34
  notifeeLib.default.registerForegroundService(() => {
34
35
  const task = new Promise((resolve) => {
35
- const logger = getLogger(['setForegroundService method']);
36
- logger('info', 'Foreground service running for call in progress');
36
+ const logger = videoLoggerSystem.getLogger(
37
+ 'setForegroundService method',
38
+ );
39
+ logger.info('Foreground service running for call in progress');
37
40
  // any task to run from SDK in the foreground service must be added
38
41
  resolve(true);
39
42
  });
@@ -42,8 +45,10 @@ function setForegroundService() {
42
45
  const { taskToRun } = foregroundServiceConfig.android;
43
46
  const call = callToPassToForegroundService.current;
44
47
  if (!call) {
45
- const logger = getLogger(['setForegroundService method']);
46
- logger('warn', 'No call to pass to foreground service');
48
+ const logger = videoLoggerSystem.getLogger(
49
+ 'setForegroundService method',
50
+ );
51
+ logger.warn('No call to pass to foreground service');
47
52
  return task.then(() => new Promise(() => {}));
48
53
  }
49
54
  callToPassToForegroundService.current = undefined;
@@ -57,9 +62,8 @@ async function startForegroundService(call_cid: string) {
57
62
  const isCallAliveConfigured =
58
63
  await NativeModules.StreamVideoReactNative.isCallAliveConfigured();
59
64
  if (!isCallAliveConfigured) {
60
- const logger = getLogger(['startForegroundService']);
61
- logger(
62
- 'info',
65
+ const logger = videoLoggerSystem.getLogger('startForegroundService');
66
+ logger.info(
63
67
  'KeepCallAlive is not configured. Skipping foreground service setup.',
64
68
  );
65
69
  return;
@@ -70,9 +74,8 @@ async function startForegroundService(call_cid: string) {
70
74
  if (
71
75
  settings.authorizationStatus !== notifeeLib.AuthorizationStatus.AUTHORIZED
72
76
  ) {
73
- const logger = getLogger(['startForegroundService']);
74
- logger(
75
- 'info',
77
+ const logger = videoLoggerSystem.getLogger('startForegroundService');
78
+ logger.info(
76
79
  'Notification permission not granted, can not start foreground service to keep the call alive',
77
80
  );
78
81
  return;
@@ -1,7 +1,7 @@
1
1
  import {
2
- getLogger,
3
2
  OwnCapability,
4
3
  type PermissionRequestEvent,
4
+ videoLoggerSystem,
5
5
  } from '@stream-io/video-client';
6
6
  import { useCall, useCallStateHooks } from '@stream-io/video-react-bindings';
7
7
  import { useCallback, useEffect } from 'react';
@@ -39,8 +39,8 @@ export const usePermissionRequest = () => {
39
39
  await call?.revokePermissions(user.id, permissions);
40
40
  }
41
41
  } catch (err) {
42
- const logger = getLogger(['usePermissionRequest']);
43
- logger('error', 'error handling permissions: ', err);
42
+ const logger = videoLoggerSystem.getLogger('usePermissionRequest');
43
+ logger.error('error handling permissions: ', err);
44
44
  }
45
45
  };
46
46
  },
@@ -1,7 +1,7 @@
1
1
  import {
2
- getLogger,
3
2
  hasScreenShare,
4
3
  OwnCapability,
4
+ videoLoggerSystem,
5
5
  } from '@stream-io/video-client';
6
6
  import { useCall, useCallStateHooks } from '@stream-io/video-react-bindings';
7
7
  import React, { useEffect, useRef } from 'react';
@@ -87,9 +87,8 @@ export const useScreenShareButton = (
87
87
 
88
88
  const onPress = async () => {
89
89
  if (!hasScreenSharingPermissions) {
90
- const logger = getLogger(['useScreenShareButton']);
91
- logger(
92
- 'info',
90
+ const logger = videoLoggerSystem.getLogger('useScreenShareButton');
91
+ logger.info(
93
92
  'User does not have permissions to stream the screen share media, calling onMissingScreenShareStreamPermission handler if present',
94
93
  );
95
94
  onMissingScreenShareStreamPermission?.();
@@ -106,9 +105,8 @@ export const useScreenShareButton = (
106
105
  onScreenShareStartedHandler?.();
107
106
  } catch (error) {
108
107
  // ignored.. user didnt allow the screen share in the popup
109
- const logger = getLogger(['useScreenShareButton']);
110
- logger(
111
- 'info',
108
+ const logger = videoLoggerSystem.getLogger('useScreenShareButton');
109
+ logger.info(
112
110
  'User opted to not give permissions to start a screen share stream',
113
111
  error,
114
112
  );
@@ -4,7 +4,7 @@ import { NativeModules, Platform } from 'react-native';
4
4
  import type { MediaStream } from '@stream-io/react-native-webrtc';
5
5
  import {
6
6
  StreamVideoParticipant,
7
- getLogger,
7
+ videoLoggerSystem,
8
8
  type VideoTrackType,
9
9
  } from '@stream-io/video-client';
10
10
 
@@ -49,11 +49,9 @@ export function useScreenshot(): UseScreenshotResult {
49
49
  videoStreamForScreenshot.toURL(),
50
50
  );
51
51
  } catch (error) {
52
- getLogger(['useScreenshot'])(
53
- 'error',
54
- 'Error taking screenshot',
55
- error,
56
- );
52
+ videoLoggerSystem
53
+ .getLogger('useScreenshot')
54
+ .error('Error taking screenshot', error);
57
55
  return null;
58
56
  }
59
57
  }
@@ -62,11 +60,9 @@ export function useScreenshot(): UseScreenshotResult {
62
60
  try {
63
61
  return await take(participant, videoTrackType);
64
62
  } catch (error) {
65
- getLogger(['useScreenshot'])(
66
- 'error',
67
- 'Error taking screenshot',
68
- error,
69
- );
63
+ videoLoggerSystem
64
+ .getLogger('useScreenshot')
65
+ .error('Error taking screenshot', error);
70
66
  return null;
71
67
  }
72
68
  }
@@ -11,10 +11,10 @@ import { NativeEventEmitter, NativeModules } from 'react-native';
11
11
  * `tracktype` should be 'videoTrack' for video track and 'screenShareTrack' for screen share track.
12
12
  */
13
13
  export function useTrackDimensions(
14
- participant: StreamVideoParticipant,
14
+ participant: StreamVideoParticipant | undefined,
15
15
  trackType: VideoTrackType,
16
16
  ) {
17
- const { videoStream, screenShareStream } = participant;
17
+ const { videoStream, screenShareStream } = participant || {};
18
18
  const stream =
19
19
  trackType === 'screenShareTrack' ? screenShareStream : videoStream;
20
20
  const [track] = stream?.getVideoTracks() ?? [];
@@ -1,4 +1,4 @@
1
- import { getLogger } from '@stream-io/video-client';
1
+ import { videoLoggerSystem } from '@stream-io/video-client';
2
2
 
3
3
  declare class RNInCallManagerLib {
4
4
  start(setup?: {
@@ -18,10 +18,11 @@ try {
18
18
 
19
19
  export function getRNInCallManagerLibNoThrow() {
20
20
  if (rnInCallManagerLib) {
21
- getLogger(['getRNInCallManagerLibNoThrow'])(
22
- 'debug',
23
- 'react-native-incall-manager library is not required to be installed from 1.22.0 version of the @stream-io/video-react-native-sdk. Please check the migration documentation at https://getstream.io/video/docs/react-native/migration-guides/1.22.0/ for more details.',
24
- );
21
+ videoLoggerSystem
22
+ .getLogger('getRNInCallManagerLibNoThrow')
23
+ .debug(
24
+ 'react-native-incall-manager library is not required to be installed from 1.22.0 version of the @stream-io/video-react-native-sdk. Please check the migration documentation at https://getstream.io/video/docs/react-native/migration-guides/1.22.0/ for more details.',
25
+ );
25
26
  }
26
27
  return rnInCallManagerLib;
27
28
  }
@@ -1,7 +1,7 @@
1
1
  import { useEffect } from 'react';
2
2
  import { useStreamVideoClient } from '@stream-io/video-react-bindings';
3
3
  import { StreamVideoRN } from '../utils';
4
- import { getLogger } from '@stream-io/video-client';
4
+ import { videoLoggerSystem } from '@stream-io/video-client';
5
5
 
6
6
  const BUSY_TONE_DURATION_IN_MS = 1500;
7
7
 
@@ -23,15 +23,14 @@ const BusyTonePlayer = () => {
23
23
 
24
24
  let busyToneTimeout: ReturnType<typeof setTimeout> | undefined;
25
25
 
26
- const logger = getLogger(['RejectCallWhenBusy']);
26
+ const logger = videoLoggerSystem.getLogger('RejectCallWhenBusy');
27
27
 
28
28
  if (isCalleeBusy) {
29
29
  if (busyToneTimeout) {
30
30
  clearTimeout(busyToneTimeout);
31
31
  busyToneTimeout = undefined;
32
32
  }
33
- logger(
34
- 'info',
33
+ logger.info(
35
34
  `Playing busy tone for call rejection for call cid: ${event.call.cid}`,
36
35
  );
37
36
 
@@ -40,24 +39,21 @@ const BusyTonePlayer = () => {
40
39
  busyToneTimeout = setTimeout(() => {
41
40
  StreamVideoRN.stopBusyTone()
42
41
  .then(() => {
43
- logger(
44
- 'info',
42
+ logger.info(
45
43
  `Stopped busy tone for call rejection for call cid: ${event.call.cid}`,
46
44
  );
47
45
  })
48
- .catch((error) =>
49
- logger('error', 'stopBusyTone failed:', error),
50
- );
46
+ .catch((error) => logger.error('stopBusyTone failed:', error));
51
47
  busyToneTimeout = undefined;
52
48
  }, BUSY_TONE_DURATION_IN_MS);
53
49
  })
54
50
  .catch((error) => {
55
- logger('error', 'playBusyTone failed:', error);
51
+ logger.error('playBusyTone failed:', error);
56
52
  });
57
53
  }
58
54
  return () => {
59
55
  StreamVideoRN.stopBusyTone().catch((err) =>
60
- logger('error', 'stopBusyTone on cleanup failed:', err),
56
+ logger.error('stopBusyTone on cleanup failed:', err),
61
57
  );
62
58
  clearTimeout(busyToneTimeout);
63
59
  unsubscribe();
@@ -6,9 +6,9 @@ import React, {
6
6
  useState,
7
7
  } from 'react';
8
8
  import {
9
- getLogger,
10
9
  NoiseCancellationSettingsModeEnum,
11
10
  OwnCapability,
11
+ videoLoggerSystem,
12
12
  } from '@stream-io/video-client';
13
13
 
14
14
  import { useCall, useCallStateHooks } from '@stream-io/video-react-bindings';
@@ -100,22 +100,18 @@ export const NoiseCancellationProvider = (props: PropsWithChildren<{}>) => {
100
100
  call.microphone
101
101
  .enableNoiseCancellation(ncInstance)
102
102
  .catch((err) =>
103
- getLogger(['NoiseCancellationProvider'])(
104
- 'error',
105
- `Can't initialize noise suppression`,
106
- err,
107
- ),
103
+ videoLoggerSystem
104
+ .getLogger('NoiseCancellationProvider')
105
+ .error(`Can't initialize noise suppression`, err),
108
106
  );
109
107
 
110
108
  return () => {
111
109
  call.microphone
112
110
  .disableNoiseCancellation()
113
111
  .catch((err) =>
114
- getLogger(['NoiseCancellationProvider'])(
115
- 'error',
116
- `Can't disable noise suppression`,
117
- err,
118
- ),
112
+ videoLoggerSystem
113
+ .getLogger('NoiseCancellationProvider')
114
+ .error(`Can't disable noise suppression`, err),
119
115
  );
120
116
  unsubscribe();
121
117
  };
@@ -8,7 +8,7 @@ import {
8
8
  } from 'react-native';
9
9
  import { shouldDisableIOSLocalVideoOnBackgroundRef } from '../../utils/internal/shouldDisableIOSLocalVideoOnBackground';
10
10
  import { disablePiPMode$, isInPiPMode$ } from '../../utils/internal/rxSubjects';
11
- import { getLogger, RxUtils } from '@stream-io/video-client';
11
+ import { RxUtils, videoLoggerSystem } from '@stream-io/video-client';
12
12
 
13
13
  const PIP_CHANGE_EVENT = 'StreamVideoReactNative_PIP_CHANGE_EVENT';
14
14
 
@@ -29,17 +29,16 @@ export const AppStateListener = () => {
29
29
  }
30
30
 
31
31
  const disablePiP = RxUtils.getCurrentValue(disablePiPMode$);
32
- const logger = getLogger(['AppStateListener']);
32
+ const logger = videoLoggerSystem.getLogger('AppStateListener');
33
33
  const initialPipMode =
34
34
  !disablePiP && AppState.currentState === 'background';
35
35
  isInPiPMode$.next(initialPipMode);
36
- logger('debug', 'Initial PiP mode on mount set to ', initialPipMode);
36
+ logger.debug('Initial PiP mode on mount set to ', initialPipMode);
37
37
 
38
38
  NativeModules?.StreamVideoReactNative?.isInPiPMode().then(
39
39
  (isInPiP: boolean | null | undefined) => {
40
40
  isInPiPMode$.next(!!isInPiP);
41
- logger(
42
- 'debug',
41
+ logger.debug(
43
42
  'Initial PiP mode on mount (after asking native module) set to ',
44
43
  !!isInPiP,
45
44
  );
@@ -67,7 +66,7 @@ export const AppStateListener = () => {
67
66
  // we dont check for inactive states
68
67
  // ref: https://www.reddit.com/r/reactnative/comments/15kib42/appstate_behavior_in_ios_when_swiping_down_to/
69
68
  const subscription = AppState.addEventListener('change', (nextAppState) => {
70
- const logger = getLogger(['AppStateListener']);
69
+ const logger = videoLoggerSystem.getLogger('AppStateListener');
71
70
  if (appState.current.match(/background/) && nextAppState === 'active') {
72
71
  if (call?.camera?.state.status === 'enabled') {
73
72
  // Android: when device is locked and resumed, the status isnt made disabled but stays enabled
@@ -76,15 +75,12 @@ export const AppStateListener = () => {
76
75
  call?.camera?.disable(true).then(() => {
77
76
  call?.camera?.enable();
78
77
  });
79
- logger(
80
- 'debug',
81
- 'Disable and reenable camera as app came to foreground',
82
- );
78
+ logger.debug('Disable and reenable camera as app came to foreground');
83
79
  } else {
84
80
  if (cameraDisabledByAppState.current) {
85
81
  call?.camera?.resume();
86
82
  cameraDisabledByAppState.current = false;
87
- logger('debug', 'Resume camera as app came to foreground');
83
+ logger.debug('Resume camera as app came to foreground');
88
84
  }
89
85
  }
90
86
  appState.current = nextAppState;
@@ -96,7 +92,7 @@ export const AppStateListener = () => {
96
92
  if (call?.camera?.state.status === 'enabled') {
97
93
  cameraDisabledByAppState.current = true;
98
94
  call?.camera?.disable();
99
- logger('debug', 'Camera disabled by app going to background');
95
+ logger.debug('Camera disabled by app going to background');
100
96
  }
101
97
  };
102
98
  if (Platform.OS === 'android') {
@@ -1,5 +1,5 @@
1
- import { getLogger } from '@stream-io/video-client';
2
1
  import { NativeModules, Platform } from 'react-native';
2
+ import { videoLoggerSystem } from '@stream-io/video-client';
3
3
 
4
4
  export async function getAndroidDefaultRingtoneUrl(): Promise<
5
5
  string | undefined
@@ -12,8 +12,8 @@ export async function getAndroidDefaultRingtoneUrl(): Promise<
12
12
  await NativeModules.StreamVideoReactNative?.getDefaultRingtoneUrl();
13
13
  return url;
14
14
  } catch (e) {
15
- const logger = getLogger(['getAndroidDefaultRingtoneUrl']);
16
- logger('warn', 'Failed to get default ringtone from native module', e);
15
+ const logger = videoLoggerSystem.getLogger('getAndroidDefaultRingtoneUrl');
16
+ logger.warn('Failed to get default ringtone from native module', e);
17
17
  }
18
18
 
19
19
  return undefined;