@stream-io/video-client 1.27.5 → 1.28.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.
package/dist/index.cjs.js CHANGED
@@ -61,6 +61,20 @@ const FrameRecordingSettingsResponseModeEnum = {
61
61
  DISABLED: 'disabled',
62
62
  AUTO_ON: 'auto-on',
63
63
  };
64
+ /**
65
+ * @export
66
+ */
67
+ const IngressAudioEncodingOptionsRequestChannelsEnum = {
68
+ NUMBER_1: 1,
69
+ NUMBER_2: 2,
70
+ };
71
+ /**
72
+ * @export
73
+ */
74
+ const IngressVideoLayerRequestCodecEnum = {
75
+ H264: 'h264',
76
+ VP8: 'vp8',
77
+ };
64
78
  /**
65
79
  * @export
66
80
  */
@@ -93,6 +107,7 @@ const OwnCapability = {
93
107
  JOIN_BACKSTAGE: 'join-backstage',
94
108
  JOIN_CALL: 'join-call',
95
109
  JOIN_ENDED_CALL: 'join-ended-call',
110
+ KICK_USER: 'kick-user',
96
111
  MUTE_USERS: 'mute-users',
97
112
  PIN_FOR_EVERYONE: 'pin-for-everyone',
98
113
  READ_CALL: 'read-call',
@@ -5289,6 +5304,7 @@ class CallState {
5289
5304
  this.eventHandlers = {
5290
5305
  // these events are not updating the call state:
5291
5306
  'call.frame_recording_ready': undefined,
5307
+ 'call.kicked_user': undefined,
5292
5308
  'call.moderation_blur': undefined,
5293
5309
  'call.moderation_warning': undefined,
5294
5310
  'call.permission_request': undefined,
@@ -5298,6 +5314,7 @@ class CallState {
5298
5314
  'call.rtmp_broadcast_stopped': undefined,
5299
5315
  'call.stats_report_ready': undefined,
5300
5316
  'call.transcription_ready': undefined,
5317
+ 'call.user_feedback_submitted': undefined,
5301
5318
  'call.user_muted': undefined,
5302
5319
  'connection.error': undefined,
5303
5320
  'connection.ok': undefined,
@@ -5638,7 +5655,7 @@ const getSdkVersion = (sdk) => {
5638
5655
  return sdk ? `${sdk.major}.${sdk.minor}.${sdk.patch}` : '0.0.0-development';
5639
5656
  };
5640
5657
 
5641
- const version = "1.27.5";
5658
+ const version = "1.28.1";
5642
5659
  const [major, minor, patch] = version.split('.');
5643
5660
  let sdkInfo = {
5644
5661
  type: SdkType.PLAIN_JAVASCRIPT,
@@ -8728,10 +8745,6 @@ const registerEventHandlers = (call, dispatcher) => {
8728
8745
  call.on('inboundStateNotification', watchInboundStateNotification(state)),
8729
8746
  handleRemoteSoftMute(call),
8730
8747
  ];
8731
- if (call.ringing) {
8732
- // these events are only relevant when the call is ringing
8733
- eventHandlers.push(registerRingingCallEventHandlers(call));
8734
- }
8735
8748
  return () => {
8736
8749
  eventHandlers.forEach((unsubscribe) => unsubscribe());
8737
8750
  };
@@ -11523,6 +11536,21 @@ class Call {
11523
11536
  });
11524
11537
  }
11525
11538
  }));
11539
+ if (this.ringing) {
11540
+ // if the call is ringing, we need to register the ringing call effects
11541
+ this.handleRingingCall();
11542
+ }
11543
+ else {
11544
+ // if the call is not ringing, we need to register the ringing call subscriptions
11545
+ // to handle the case when the call gets ringing flag after creation event
11546
+ this.leaveCallHooks.add(
11547
+ // "ringing" mode effects and event handlers
11548
+ createSubscription(this.ringingSubject, (isRinging) => {
11549
+ if (!isRinging)
11550
+ return;
11551
+ this.handleRingingCall();
11552
+ }));
11553
+ }
11526
11554
  this.leaveCallHooks.add(
11527
11555
  // cancel auto-drop when call is accepted or rejected
11528
11556
  createSubscription(this.state.session$, (session) => {
@@ -11544,53 +11572,49 @@ class Call {
11544
11572
  });
11545
11573
  }
11546
11574
  }));
11547
- this.leaveCallHooks.add(
11548
- // "ringing" mode effects and event handlers
11549
- createSubscription(this.ringingSubject, (isRinging) => {
11550
- if (!isRinging)
11551
- return;
11552
- const callSession = this.state.session;
11553
- const receiver_id = this.clientStore.connectedUser?.id;
11554
- const ended_at = callSession?.ended_at;
11555
- const created_by_id = this.state.createdBy?.id;
11556
- const rejected_by = callSession?.rejected_by;
11557
- const accepted_by = callSession?.accepted_by;
11558
- let leaveCallIdle = false;
11559
- if (ended_at) {
11560
- // call was ended before it was accepted or rejected so we should leave it to idle
11575
+ };
11576
+ this.handleRingingCall = () => {
11577
+ const callSession = this.state.session;
11578
+ const receiver_id = this.clientStore.connectedUser?.id;
11579
+ const ended_at = callSession?.ended_at;
11580
+ const created_by_id = this.state.createdBy?.id;
11581
+ const rejected_by = callSession?.rejected_by;
11582
+ const accepted_by = callSession?.accepted_by;
11583
+ let leaveCallIdle = false;
11584
+ if (ended_at) {
11585
+ // call was ended before it was accepted or rejected so we should leave it to idle
11586
+ leaveCallIdle = true;
11587
+ }
11588
+ else if (created_by_id && rejected_by) {
11589
+ if (rejected_by[created_by_id]) {
11590
+ // call was cancelled by the caller
11561
11591
  leaveCallIdle = true;
11562
11592
  }
11563
- else if (created_by_id && rejected_by) {
11564
- if (rejected_by[created_by_id]) {
11565
- // call was cancelled by the caller
11566
- leaveCallIdle = true;
11567
- }
11568
- }
11569
- else if (receiver_id && rejected_by) {
11570
- if (rejected_by[receiver_id]) {
11571
- // call was rejected by the receiver in some other device
11572
- leaveCallIdle = true;
11573
- }
11593
+ }
11594
+ else if (receiver_id && rejected_by) {
11595
+ if (rejected_by[receiver_id]) {
11596
+ // call was rejected by the receiver in some other device
11597
+ leaveCallIdle = true;
11574
11598
  }
11575
- else if (receiver_id && accepted_by) {
11576
- if (accepted_by[receiver_id]) {
11577
- // call was accepted by the receiver in some other device
11578
- leaveCallIdle = true;
11579
- }
11599
+ }
11600
+ else if (receiver_id && accepted_by) {
11601
+ if (accepted_by[receiver_id]) {
11602
+ // call was accepted by the receiver in some other device
11603
+ leaveCallIdle = true;
11580
11604
  }
11581
- if (leaveCallIdle) {
11582
- if (this.state.callingState !== exports.CallingState.IDLE) {
11583
- this.state.setCallingState(exports.CallingState.IDLE);
11584
- }
11605
+ }
11606
+ if (leaveCallIdle) {
11607
+ if (this.state.callingState !== exports.CallingState.IDLE) {
11608
+ this.state.setCallingState(exports.CallingState.IDLE);
11585
11609
  }
11586
- else {
11587
- if (this.state.callingState === exports.CallingState.IDLE) {
11588
- this.state.setCallingState(exports.CallingState.RINGING);
11589
- }
11590
- this.scheduleAutoDrop();
11591
- this.leaveCallHooks.add(registerRingingCallEventHandlers(this));
11610
+ }
11611
+ else {
11612
+ if (this.state.callingState === exports.CallingState.IDLE) {
11613
+ this.state.setCallingState(exports.CallingState.RINGING);
11592
11614
  }
11593
- }));
11615
+ this.scheduleAutoDrop();
11616
+ this.leaveCallHooks.add(registerRingingCallEventHandlers(this));
11617
+ }
11594
11618
  };
11595
11619
  this.handleOwnCapabilitiesUpdated = async (ownCapabilities) => {
11596
11620
  // update the permission context.
@@ -12789,6 +12813,13 @@ class Call {
12789
12813
  user_id: userId,
12790
12814
  });
12791
12815
  };
12816
+ /**
12817
+ * Kicks the user with the given `userId`.
12818
+ * @param data the kick request.
12819
+ */
12820
+ this.kickUser = async (data) => {
12821
+ return this.streamClient.post(`${this.streamClientBasePath}/kick`, data);
12822
+ };
12792
12823
  /**
12793
12824
  * Mutes the current user.
12794
12825
  *
@@ -14538,7 +14569,7 @@ class StreamClient {
14538
14569
  this.getUserAgent = () => {
14539
14570
  if (!this.cachedUserAgent) {
14540
14571
  const { clientAppIdentifier = {} } = this.options;
14541
- const { sdkName = 'js', sdkVersion = "1.27.5", ...extras } = clientAppIdentifier;
14572
+ const { sdkName = 'js', sdkVersion = "1.28.1", ...extras } = clientAppIdentifier;
14542
14573
  this.cachedUserAgent = [
14543
14574
  `stream-video-${sdkName}-v${sdkVersion}`,
14544
14575
  ...Object.entries(extras).map(([key, value]) => `${key}=${value}`),
@@ -15122,6 +15153,8 @@ exports.ErrorFromResponse = ErrorFromResponse;
15122
15153
  exports.FrameRecordingSettingsRequestModeEnum = FrameRecordingSettingsRequestModeEnum;
15123
15154
  exports.FrameRecordingSettingsRequestQualityEnum = FrameRecordingSettingsRequestQualityEnum;
15124
15155
  exports.FrameRecordingSettingsResponseModeEnum = FrameRecordingSettingsResponseModeEnum;
15156
+ exports.IngressAudioEncodingOptionsRequestChannelsEnum = IngressAudioEncodingOptionsRequestChannelsEnum;
15157
+ exports.IngressVideoLayerRequestCodecEnum = IngressVideoLayerRequestCodecEnum;
15125
15158
  exports.InputMediaDeviceManager = InputMediaDeviceManager;
15126
15159
  exports.InputMediaDeviceManagerState = InputMediaDeviceManagerState;
15127
15160
  exports.LayoutSettingsRequestNameEnum = LayoutSettingsRequestNameEnum;