@cometchat/calls-sdk-javascript 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.ts CHANGED
@@ -19,6 +19,7 @@ declare type AudioMode = {
19
19
  type: AudioModeType;
20
20
  selected: boolean;
21
21
  uid?: string;
22
+ name?: string;
22
23
  };
23
24
 
24
25
  declare type AudioModeType = 'BLUETOOTH' | 'EARPIECE' | 'HEADPHONES' | 'SPEAKER';
@@ -233,10 +234,22 @@ export declare class CallLog {
233
234
  * The time the call was initiated at.
234
235
  */
235
236
  private initiatedAt;
237
+ /**
238
+ * The time the call started at. Sent by the calls host in place of
239
+ * `initiatedAt`; read {@link getStartedAt} and fall back to
240
+ * {@link getInitiatedAt} when only one of the two is present.
241
+ */
242
+ private startedAt;
236
243
  /**
237
244
  * The call category of the call log.
238
245
  */
239
246
  private callCategory;
247
+ /**
248
+ * The mode of the call log. Sent by the calls host in place of
249
+ * `callCategory`; read {@link getMode} and fall back to
250
+ * {@link getCallCategory} when only one of the two is present.
251
+ */
252
+ private mode;
240
253
  /**
241
254
  * @type {CallUser}
242
255
  * The initiator of the call log.
@@ -350,6 +363,26 @@ export declare class CallLog {
350
363
  * @param value - The time the call was initiated at.
351
364
  */
352
365
  setInitiatedAt(value: number): void;
366
+ /**
367
+ * Gets the time the call started at.
368
+ * @returns The time the call started at.
369
+ */
370
+ getStartedAt(): number;
371
+ /**
372
+ * Sets the time the call started at.
373
+ * @param value - The time the call started at.
374
+ */
375
+ setStartedAt(value: number): void;
376
+ /**
377
+ * Gets the mode of the call log.
378
+ * @returns The mode of the call log.
379
+ */
380
+ getMode(): string;
381
+ /**
382
+ * Sets the mode of the call log.
383
+ * @param value - The mode to set.
384
+ */
385
+ setMode(value: string): void;
353
386
  /**
354
387
  * Gets the call category of the call log.
355
388
  * @returns The call category of the call log.
@@ -545,6 +578,16 @@ declare class CallLogRequest {
545
578
  * @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..
546
579
  */
547
580
  fetchPrevious(): Promise<CallLog[] | []>;
581
+ /**
582
+ * Gets the page the cursor currently sits on.
583
+ * @returns The current page, or `0` before the first successful fetch.
584
+ */
585
+ getCurrentPage(): number;
586
+ /**
587
+ * Gets the number of pages the server reported.
588
+ * @returns The total page count, or `0` before the first successful fetch.
589
+ */
590
+ getTotalPages(): number;
548
591
  /**
549
592
  * Makes an API call to fetch call logs.
550
593
  * @param isFetchNext Whether to fetch the next page of call logs.
@@ -1147,6 +1190,29 @@ declare type ConfigStateBoth = {
1147
1190
  * @default true
1148
1191
  */
1149
1192
  hideRecordingButton: boolean;
1193
+ /**
1194
+ * Hides the streaming button from the call controls, preventing the user
1195
+ * from manually starting or stopping a live stream from within the SDK UI.
1196
+ *
1197
+ * @default true
1198
+ */
1199
+ hideStreamingButton: boolean;
1200
+ /**
1201
+ * The RTMP URL to stream to when the user starts a live stream from the
1202
+ * call controls. When set, pressing the start-streaming button skips the
1203
+ * confirmation dialog (which normally asks for a URL and key) and starts
1204
+ * streaming to this URL immediately.
1205
+ *
1206
+ * @default undefined — the user is asked for a URL when starting a stream
1207
+ */
1208
+ streamUrl?: string;
1209
+ /**
1210
+ * The stream key sent along with `streamUrl` when a live stream is
1211
+ * started. Ignored when `streamUrl` is not set.
1212
+ *
1213
+ * @default undefined
1214
+ */
1215
+ streamKey?: string;
1150
1216
  /**
1151
1217
  * Hides the entire bottom control bar (mic, camera, leave, and every other
1152
1218
  * call control). Useful when the host app provides its own controls.
@@ -1233,6 +1299,13 @@ declare type ConfigStateBoth = {
1233
1299
  * @default false
1234
1300
  */
1235
1301
  hideRecordingStatusIndicator: boolean;
1302
+ /**
1303
+ * Hides the "streaming live" badge shown while the session is being
1304
+ * streamed. The stream itself is unaffected.
1305
+ *
1306
+ * @default false
1307
+ */
1308
+ hideStreamingStatusIndicator: boolean;
1236
1309
  /**
1237
1310
  * Hides the button that switches between the front and rear cameras.
1238
1311
  * Mainly relevant on mobile devices with more than one camera.
@@ -1433,6 +1506,8 @@ declare const EVENT_LISTENER_METHODS: {
1433
1506
  readonly onVideoResumed: "onVideoResumed";
1434
1507
  readonly onRecordingStarted: "onRecordingStarted";
1435
1508
  readonly onRecordingStopped: "onRecordingStopped";
1509
+ readonly onStreamingStarted: "onStreamingStarted";
1510
+ readonly onStreamingStopped: "onStreamingStopped";
1436
1511
  readonly onScreenShareStarted: "onScreenShareStarted";
1437
1512
  readonly onScreenShareStopped: "onScreenShareStopped";
1438
1513
  };
@@ -1449,6 +1524,8 @@ declare const EVENT_LISTENER_METHODS: {
1449
1524
  readonly onParticipantStoppedScreenShare: "onParticipantStoppedScreenShare";
1450
1525
  readonly onParticipantStartedRecording: "onParticipantStartedRecording";
1451
1526
  readonly onParticipantStoppedRecording: "onParticipantStoppedRecording";
1527
+ readonly onParticipantStartedStreaming: "onParticipantStartedStreaming";
1528
+ readonly onParticipantStoppedStreaming: "onParticipantStoppedStreaming";
1452
1529
  readonly onDominantSpeakerChanged: "onDominantSpeakerChanged";
1453
1530
  readonly onParticipantListChanged: "onParticipantListChanged";
1454
1531
  };
@@ -2144,9 +2221,15 @@ declare class SessionMethods extends SessionMethodsCore {
2144
2221
 
2145
2222
  declare class SessionMethodsCore {
2146
2223
  /**
2147
- * Mutes the local user's audio during the call.
2224
+ * Mutes or unmutes the local user's audio during the call.
2225
+ *
2226
+ * The boolean parameter exists for backward compatibility with the v4 SDK,
2227
+ * where `muteAudio(false)` was the way to unmute. New code should prefer
2228
+ * {@link SessionMethodsCore.unmuteAudio} for clarity.
2229
+ *
2230
+ * @param muteAudio - `true` (default) mutes the local audio track, `false` unmutes it.
2148
2231
  */
2149
- static muteAudio(): void;
2232
+ static muteAudio(muteAudio?: boolean): void;
2150
2233
  /**
2151
2234
  * Unmutes the local user's audio during the call.
2152
2235
  */
@@ -2157,9 +2240,15 @@ declare class SessionMethodsCore {
2157
2240
  */
2158
2241
  static toggleAudio(): void;
2159
2242
  /**
2160
- * Pauses the local user's video stream.
2243
+ * Pauses or resumes the local user's video stream.
2244
+ *
2245
+ * The boolean parameter exists for backward compatibility with the v4 SDK,
2246
+ * where `pauseVideo(false)` was the way to resume. New code should prefer
2247
+ * {@link SessionMethodsCore.resumeVideo} for clarity.
2248
+ *
2249
+ * @param pauseVideo - `true` (default) pauses the local video track, `false` resumes it.
2161
2250
  */
2162
- static pauseVideo(): void;
2251
+ static pauseVideo(pauseVideo?: boolean): void;
2163
2252
  /**
2164
2253
  * Resumes the local user's video stream.
2165
2254
  */
@@ -2200,6 +2289,16 @@ declare class SessionMethodsCore {
2200
2289
  * @param layout - The type of layout to set (tile, sidebar or spotlight).
2201
2290
  */
2202
2291
  static setLayout(layout: Layout): void;
2292
+ /**
2293
+ * Starts streaming the call to the given RTMP destination.
2294
+ * @param streamUrl - The RTMP ingest URL (e.g., "rtmp://a.rtmp.youtube.com/live2").
2295
+ * @param streamKey - The stream key for the destination (e.g., "xxxx-xxxx-xxxx-xxxx-xxxx").
2296
+ */
2297
+ static startStreaming(streamUrl: string, streamKey: string): void;
2298
+ /**
2299
+ * Stops the ongoing call streaming.
2300
+ */
2301
+ static stopStreaming(): void;
2203
2302
  /**
2204
2303
  * Starts recording the call.
2205
2304
  */