@cometchat/calls-sdk-react-native 5.0.3 → 5.0.4

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.
package/dist/index.d.mts CHANGED
@@ -127,6 +127,8 @@ declare const EVENT_LISTENER_METHODS: {
127
127
  readonly onVideoResumed: "onVideoResumed";
128
128
  readonly onRecordingStarted: "onRecordingStarted";
129
129
  readonly onRecordingStopped: "onRecordingStopped";
130
+ readonly onStreamingStarted: "onStreamingStarted";
131
+ readonly onStreamingStopped: "onStreamingStopped";
130
132
  readonly onScreenShareStarted: "onScreenShareStarted";
131
133
  readonly onScreenShareStopped: "onScreenShareStopped";
132
134
  };
@@ -143,6 +145,8 @@ declare const EVENT_LISTENER_METHODS: {
143
145
  readonly onParticipantStoppedScreenShare: "onParticipantStoppedScreenShare";
144
146
  readonly onParticipantStartedRecording: "onParticipantStartedRecording";
145
147
  readonly onParticipantStoppedRecording: "onParticipantStoppedRecording";
148
+ readonly onParticipantStartedStreaming: "onParticipantStartedStreaming";
149
+ readonly onParticipantStoppedStreaming: "onParticipantStoppedStreaming";
146
150
  readonly onDominantSpeakerChanged: "onDominantSpeakerChanged";
147
151
  readonly onParticipantListChanged: "onParticipantListChanged";
148
152
  };
@@ -178,6 +182,8 @@ declare const EVENT_LISTENER_METHODS_WEB: {
178
182
  readonly onVideoResumed: "onVideoResumed";
179
183
  readonly onRecordingStarted: "onRecordingStarted";
180
184
  readonly onRecordingStopped: "onRecordingStopped";
185
+ readonly onStreamingStarted: "onStreamingStarted";
186
+ readonly onStreamingStopped: "onStreamingStopped";
181
187
  readonly onScreenShareStarted: "onScreenShareStarted";
182
188
  readonly onScreenShareStopped: "onScreenShareStopped";
183
189
  };
@@ -205,6 +211,8 @@ declare const EVENT_LISTENER_METHODS_WEB: {
205
211
  readonly onParticipantStoppedScreenShare: "onParticipantStoppedScreenShare";
206
212
  readonly onParticipantStartedRecording: "onParticipantStartedRecording";
207
213
  readonly onParticipantStoppedRecording: "onParticipantStoppedRecording";
214
+ readonly onParticipantStartedStreaming: "onParticipantStartedStreaming";
215
+ readonly onParticipantStoppedStreaming: "onParticipantStoppedStreaming";
208
216
  readonly onDominantSpeakerChanged: "onDominantSpeakerChanged";
209
217
  readonly onParticipantListChanged: "onParticipantListChanged";
210
218
  };
@@ -237,6 +245,8 @@ declare const EVENT_LISTENER_METHODS_MOBILE: {
237
245
  readonly onVideoResumed: "onVideoResumed";
238
246
  readonly onRecordingStarted: "onRecordingStarted";
239
247
  readonly onRecordingStopped: "onRecordingStopped";
248
+ readonly onStreamingStarted: "onStreamingStarted";
249
+ readonly onStreamingStopped: "onStreamingStopped";
240
250
  readonly onScreenShareStarted: "onScreenShareStarted";
241
251
  readonly onScreenShareStopped: "onScreenShareStopped";
242
252
  };
@@ -284,6 +294,8 @@ declare const EVENT_LISTENER_METHODS_MOBILE: {
284
294
  readonly onParticipantStoppedScreenShare: "onParticipantStoppedScreenShare";
285
295
  readonly onParticipantStartedRecording: "onParticipantStartedRecording";
286
296
  readonly onParticipantStoppedRecording: "onParticipantStoppedRecording";
297
+ readonly onParticipantStartedStreaming: "onParticipantStartedStreaming";
298
+ readonly onParticipantStoppedStreaming: "onParticipantStoppedStreaming";
287
299
  readonly onDominantSpeakerChanged: "onDominantSpeakerChanged";
288
300
  readonly onParticipantListChanged: "onParticipantListChanged";
289
301
  };
@@ -466,6 +478,7 @@ type ConferenceState = {
466
478
  initiator?: any;
467
479
  };
468
480
  isRecording: boolean;
481
+ isStreaming: boolean;
469
482
  };
470
483
  type Actions$4 = {
471
484
  reset: () => void;
@@ -474,7 +487,6 @@ type Actions$4 = {
474
487
  lowerHand: (participantId: string) => void;
475
488
  leaveConference: () => Promise<void>;
476
489
  endConference: () => Promise<void>;
477
- stopRecording: () => Promise<void>;
478
490
  };
479
491
  declare const useConferenceStore: zustand0.UseBoundStore<Omit<zustand0.StoreApi<ConferenceState & Actions$4>, "subscribe"> & {
480
492
  subscribe: {
@@ -490,9 +502,12 @@ declare function raisedHandLocal(): void;
490
502
  declare function lowerHandLocal(): void;
491
503
  declare function toggleRaiseHand(): void;
492
504
  declare const useIsRecording: () => boolean;
505
+ declare const useIsStreaming: () => boolean;
493
506
  declare function startRecording(): Promise<void>;
494
507
  declare function stopRecording(): Promise<void>;
495
508
  declare function toggleRecording(): Promise<void>;
509
+ declare function startStreaming(streamUrl: string, streamKey: string): Promise<void>;
510
+ declare function stopStreaming(): Promise<void>;
496
511
  declare const getIsConferenceJoined: () => boolean;
497
512
  //#endregion
498
513
  //#region calls-sdk-core/store/config.d.ts
@@ -538,6 +553,20 @@ type ConfigStateMobile = {
538
553
  * @default true
539
554
  */
540
555
  enableSpotlightSwap: boolean;
556
+ /**
557
+ * iOS only (React Native). When enabled, the call automatically enters the
558
+ * system Picture-in-Picture window when the app moves to the background,
559
+ * showing the active speaker's video (or the active screen share), and
560
+ * returns to the app automatically when it is foregrounded.
561
+ *
562
+ * Requires iOS 15+ and the "Audio, AirPlay, and Picture in Picture"
563
+ * background mode capability in the host app. Ignored on Android and on
564
+ * older iOS versions. Not related to `enablePictureInPictureLayout()`,
565
+ * which shrinks the in-app call UI to a tile.
566
+ *
567
+ * @default false
568
+ */
569
+ enableIOSPictureInPicture: boolean;
541
570
  };
542
571
  /**
543
572
  * Configuration that only applies on the web platform.
@@ -637,6 +666,29 @@ type ConfigStateBoth = {
637
666
  * @default true
638
667
  */
639
668
  hideRecordingButton: boolean;
669
+ /**
670
+ * Hides the streaming button from the call controls, preventing the user
671
+ * from manually starting or stopping a live stream from within the SDK UI.
672
+ *
673
+ * @default true
674
+ */
675
+ hideStreamingButton: boolean;
676
+ /**
677
+ * The RTMP URL to stream to when the user starts a live stream from the
678
+ * call controls. When set, pressing the start-streaming button skips the
679
+ * confirmation dialog (which normally asks for a URL and key) and starts
680
+ * streaming to this URL immediately.
681
+ *
682
+ * @default undefined — the user is asked for a URL when starting a stream
683
+ */
684
+ streamUrl?: string;
685
+ /**
686
+ * The stream key sent along with `streamUrl` when a live stream is
687
+ * started. Ignored when `streamUrl` is not set.
688
+ *
689
+ * @default undefined
690
+ */
691
+ streamKey?: string;
640
692
  /**
641
693
  * Hides the entire bottom control bar (mic, camera, leave, and every other
642
694
  * call control). Useful when the host app provides its own controls.
@@ -723,6 +775,13 @@ type ConfigStateBoth = {
723
775
  * @default false
724
776
  */
725
777
  hideRecordingStatusIndicator: boolean;
778
+ /**
779
+ * Hides the "streaming live" badge shown while the session is being
780
+ * streamed. The stream itself is unaffected.
781
+ *
782
+ * @default false
783
+ */
784
+ hideStreamingStatusIndicator: boolean;
726
785
  /**
727
786
  * Hides the button that switches between the front and rear cameras.
728
787
  * Mainly relevant on mobile devices with more than one camera.
@@ -1058,6 +1117,7 @@ declare const getMainParticipantFromState: (state: {
1058
1117
  dominantSpeakers: string[];
1059
1118
  localParticipant: HumanParticipant;
1060
1119
  }) => Participant$2;
1120
+ declare const getParticipantMediaType: (participant?: Participant$2) => "video" | "screenshare";
1061
1121
  //#endregion
1062
1122
  //#region calls-sdk-core/store/toast.d.ts
1063
1123
  interface ToastAction {
@@ -1155,6 +1215,7 @@ declare const useMainParticipant: () => Participant$2;
1155
1215
  declare const getMainParticipant: () => Participant$2;
1156
1216
  declare const useIsReconnecting: () => boolean;
1157
1217
  declare const useHideRecordingButton: () => boolean;
1218
+ declare const useHideStreamingButton: () => boolean;
1158
1219
  declare const useHideVirtualBackgroundButton: () => boolean;
1159
1220
  declare const useLayout: () => Layout;
1160
1221
  declare const useEnableParticipantContextMenu: () => boolean;
@@ -1176,9 +1237,15 @@ declare const switchCamera: () => void;
1176
1237
  //#region calls-sdk-core/utils/session-methods-core.d.ts
1177
1238
  declare class SessionMethodsCore {
1178
1239
  /**
1179
- * Mutes the local user's audio during the call.
1240
+ * Mutes or unmutes the local user's audio during the call.
1241
+ *
1242
+ * The boolean parameter exists for backward compatibility with the v4 SDK,
1243
+ * where `muteAudio(false)` was the way to unmute. New code should prefer
1244
+ * {@link SessionMethodsCore.unmuteAudio} for clarity.
1245
+ *
1246
+ * @param muteAudio - `true` (default) mutes the local audio track, `false` unmutes it.
1180
1247
  */
1181
- static muteAudio(): void;
1248
+ static muteAudio(muteAudio?: boolean): void;
1182
1249
  /**
1183
1250
  * Unmutes the local user's audio during the call.
1184
1251
  */
@@ -1189,9 +1256,15 @@ declare class SessionMethodsCore {
1189
1256
  */
1190
1257
  static toggleAudio(): void;
1191
1258
  /**
1192
- * Pauses the local user's video stream.
1259
+ * Pauses or resumes the local user's video stream.
1260
+ *
1261
+ * The boolean parameter exists for backward compatibility with the v4 SDK,
1262
+ * where `pauseVideo(false)` was the way to resume. New code should prefer
1263
+ * {@link SessionMethodsCore.resumeVideo} for clarity.
1264
+ *
1265
+ * @param pauseVideo - `true` (default) pauses the local video track, `false` resumes it.
1193
1266
  */
1194
- static pauseVideo(): void;
1267
+ static pauseVideo(pauseVideo?: boolean): void;
1195
1268
  /**
1196
1269
  * Resumes the local user's video stream.
1197
1270
  */
@@ -1232,6 +1305,16 @@ declare class SessionMethodsCore {
1232
1305
  * @param layout - The type of layout to set (tile, sidebar or spotlight).
1233
1306
  */
1234
1307
  static setLayout(layout: Layout): void;
1308
+ /**
1309
+ * Starts streaming the call to the given RTMP destination.
1310
+ * @param streamUrl - The RTMP ingest URL (e.g., "rtmp://a.rtmp.youtube.com/live2").
1311
+ * @param streamKey - The stream key for the destination (e.g., "xxxx-xxxx-xxxx-xxxx-xxxx").
1312
+ */
1313
+ static startStreaming(streamUrl: string, streamKey: string): void;
1314
+ /**
1315
+ * Stops the ongoing call streaming.
1316
+ */
1317
+ static stopStreaming(): void;
1235
1318
  /**
1236
1319
  * Starts recording the call.
1237
1320
  */
@@ -1323,6 +1406,7 @@ type AudioMode = {
1323
1406
  type: AudioModeType;
1324
1407
  selected: boolean;
1325
1408
  uid?: string;
1409
+ name?: string;
1326
1410
  };
1327
1411
  type CameraFacingInternal = ValueOf<typeof CAMERA_FACING_INTERNAL>;
1328
1412
  type CameraFacing = ValueOf<typeof CAMERA_FACING>;
@@ -1565,6 +1649,16 @@ declare namespace controlPanel {
1565
1649
  let cancel_1: string;
1566
1650
  export { cancel_1 as cancel };
1567
1651
  }
1652
+ namespace streaming {
1653
+ export let startStreaming: string;
1654
+ export let stopStreaming: string;
1655
+ export let startStreamingConfirmation: string;
1656
+ export let stopStreamingConfirmation: string;
1657
+ export let streamUrlPlaceholder: string;
1658
+ export let streamKeyPlaceholder: string;
1659
+ let cancel_2: string;
1660
+ export { cancel_2 as cancel };
1661
+ }
1568
1662
  let raiseHand: string;
1569
1663
  let lowerHand: string;
1570
1664
  let startScreenSharing: string;
@@ -1606,19 +1700,39 @@ declare namespace virtualBackground {
1606
1700
  export let addBackground: string;
1607
1701
  export let noCameraFeed: string;
1608
1702
  export namespace buttons_2 {
1609
- let cancel_2: string;
1610
- export { cancel_2 as cancel };
1703
+ let cancel_3: string;
1704
+ export { cancel_3 as cancel };
1611
1705
  let done_1: string;
1612
1706
  export { done_1 as done };
1613
1707
  }
1614
1708
  export { buttons_2 as buttons };
1615
1709
  }
1710
+ declare namespace indicators {
1711
+ export namespace recording_1 {
1712
+ let label: string;
1713
+ let tooltip: string;
1714
+ }
1715
+ export { recording_1 as recording };
1716
+ export namespace streaming_1 {
1717
+ let label_1: string;
1718
+ export { label_1 as label };
1719
+ let tooltip_1: string;
1720
+ export { tooltip_1 as tooltip };
1721
+ }
1722
+ export { streaming_1 as streaming };
1723
+ }
1724
+ declare namespace notifications {
1725
+ let recordingStarted: string;
1726
+ let recordingStopped: string;
1727
+ let streamingStarted: string;
1728
+ let streamingStopped: string;
1729
+ }
1616
1730
  declare namespace general {
1617
1731
  let error: string;
1618
1732
  }
1619
1733
  declare let other: {};
1620
1734
  declare namespace __json_default_export {
1621
- export { header, controlPanel, idealTimeout, participantList, virtualBackground, general, other };
1735
+ export { header, controlPanel, idealTimeout, participantList, virtualBackground, indicators, notifications, general, other };
1622
1736
  }
1623
1737
  //#endregion
1624
1738
  //#region calls-sdk-core/i18n/state.d.ts
@@ -1651,6 +1765,11 @@ declare const useTranslationStore: zustand0.UseBoundStore<Omit<zustand0.StoreApi
1651
1765
  }>;
1652
1766
  //#endregion
1653
1767
  //#region calls-sdk-core/i18n/hook.d.ts
1768
+ /**
1769
+ * Non-hook variant of `t` for code that runs outside React (stores,
1770
+ * event subscribers). Reads the translation store imperatively.
1771
+ */
1772
+ declare function translate(key: Paths<TranslationResource>): string;
1654
1773
  declare const useTranslation: () => {
1655
1774
  t: (key: Paths<TranslationResource>) => string;
1656
1775
  currentLocale: "en-US" | Omit<string, "en-US">;
@@ -1721,6 +1840,15 @@ declare const useTranslation: () => {
1721
1840
  stopRecordingConfirmation: string;
1722
1841
  cancel: string;
1723
1842
  };
1843
+ streaming: {
1844
+ startStreaming: string;
1845
+ stopStreaming: string;
1846
+ startStreamingConfirmation: string;
1847
+ stopStreamingConfirmation: string;
1848
+ streamUrlPlaceholder: string;
1849
+ streamKeyPlaceholder: string;
1850
+ cancel: string;
1851
+ };
1724
1852
  raiseHand: string;
1725
1853
  lowerHand: string;
1726
1854
  startScreenSharing: string;
@@ -1759,6 +1887,22 @@ declare const useTranslation: () => {
1759
1887
  done: string;
1760
1888
  };
1761
1889
  };
1890
+ indicators: {
1891
+ recording: {
1892
+ label: string;
1893
+ tooltip: string;
1894
+ };
1895
+ streaming: {
1896
+ label: string;
1897
+ tooltip: string;
1898
+ };
1899
+ };
1900
+ notifications: {
1901
+ recordingStarted: string;
1902
+ recordingStopped: string;
1903
+ streamingStarted: string;
1904
+ streamingStopped: string;
1905
+ };
1762
1906
  general: {
1763
1907
  error: string;
1764
1908
  };
@@ -3444,10 +3588,22 @@ declare class CallLog {
3444
3588
  * The time the call was initiated at.
3445
3589
  */
3446
3590
  private initiatedAt;
3591
+ /**
3592
+ * The time the call started at. Sent by the calls host in place of
3593
+ * `initiatedAt`; read {@link getStartedAt} and fall back to
3594
+ * {@link getInitiatedAt} when only one of the two is present.
3595
+ */
3596
+ private startedAt;
3447
3597
  /**
3448
3598
  * The call category of the call log.
3449
3599
  */
3450
3600
  private callCategory;
3601
+ /**
3602
+ * The mode of the call log. Sent by the calls host in place of
3603
+ * `callCategory`; read {@link getMode} and fall back to
3604
+ * {@link getCallCategory} when only one of the two is present.
3605
+ */
3606
+ private mode;
3451
3607
  /**
3452
3608
  * @type {CallUser}
3453
3609
  * The initiator of the call log.
@@ -3561,6 +3717,26 @@ declare class CallLog {
3561
3717
  * @param value - The time the call was initiated at.
3562
3718
  */
3563
3719
  setInitiatedAt(value: number): void;
3720
+ /**
3721
+ * Gets the time the call started at.
3722
+ * @returns The time the call started at.
3723
+ */
3724
+ getStartedAt(): number;
3725
+ /**
3726
+ * Sets the time the call started at.
3727
+ * @param value - The time the call started at.
3728
+ */
3729
+ setStartedAt(value: number): void;
3730
+ /**
3731
+ * Gets the mode of the call log.
3732
+ * @returns The mode of the call log.
3733
+ */
3734
+ getMode(): string;
3735
+ /**
3736
+ * Sets the mode of the call log.
3737
+ * @param value - The mode to set.
3738
+ */
3739
+ setMode(value: string): void;
3564
3740
  /**
3565
3741
  * Gets the call category of the call log.
3566
3742
  * @returns The call category of the call log.
@@ -3789,6 +3965,16 @@ declare class CallLogRequest {
3789
3965
  * @returns A promise that resolves to an array of CallLog objects, or an empty array if there are no previous pages, or rejects with a CometChatCallsException if there was an error..
3790
3966
  */
3791
3967
  fetchPrevious(): Promise<CallLog[] | []>;
3968
+ /**
3969
+ * Gets the page the cursor currently sits on.
3970
+ * @returns The current page, or `0` before the first successful fetch.
3971
+ */
3972
+ getCurrentPage(): number;
3973
+ /**
3974
+ * Gets the number of pages the server reported.
3975
+ * @returns The total page count, or `0` before the first successful fetch.
3976
+ */
3977
+ getTotalPages(): number;
3792
3978
  /**
3793
3979
  * Makes an API call to fetch call logs.
3794
3980
  * @param isFetchNext Whether to fetch the next page of call logs.
@@ -4402,6 +4588,8 @@ declare class CometChatCalls extends SessionMethodsCore {
4402
4588
  static CallSettingsBuilder: typeof CallSettingsBuilder;
4403
4589
  static CallAppSettingsBuilder: typeof CallAppSettingsBuilder;
4404
4590
  static Component: typeof AppReactNativeSDK;
4591
+ static CallLogRequestBuilder: typeof CallLogRequestBuilder;
4592
+ static CallLog: typeof CallLog;
4405
4593
  /**
4406
4594
  * Initializes the CometChat Calls SDK with the provided app settings.
4407
4595
  * Must be called before any other SDK methods.