@stream-io/video-client 1.18.6 → 1.18.7

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.
@@ -153,5 +153,5 @@ export type ClientAppIdentifier = {
153
153
  };
154
154
  export type TokenProvider = () => Promise<string>;
155
155
  export type TokenOrProvider = null | string | TokenProvider | undefined;
156
- export type BuiltInRejectReason = 'busy' | 'decline' | 'cancel';
157
- export type RejectReason = BuiltInRejectReason | string;
156
+ export type BuiltInRejectReason = 'busy' | 'decline' | 'cancel' | 'timeout';
157
+ export type RejectReason = BuiltInRejectReason | (string & {});
@@ -71,7 +71,7 @@ export declare abstract class BasePeerConnection {
71
71
  /**
72
72
  * Converts the ICE candidate to a JSON string.
73
73
  */
74
- private toJSON;
74
+ private asJSON;
75
75
  /**
76
76
  * Handles the ICE connection state change event.
77
77
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stream-io/video-client",
3
- "version": "1.18.6",
3
+ "version": "1.18.7",
4
4
  "packageManager": "yarn@3.2.4",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/index.es.js",
package/src/Call.ts CHANGED
@@ -566,7 +566,7 @@ export class Call {
566
566
 
567
567
  if (callingState === CallingState.RINGING && reject !== false) {
568
568
  if (reject) {
569
- await this.reject(reason);
569
+ await this.reject('decline');
570
570
  } else {
571
571
  // if reject was undefined, we still have to cancel the call automatically
572
572
  // when I am the creator and everyone else left the call
@@ -602,6 +602,7 @@ export class Call {
602
602
  this.initialized = false;
603
603
  this.hasJoinedOnce = false;
604
604
  this.ringingSubject.next(false);
605
+ this.cancelAutoDrop();
605
606
  this.clientStore.unregisterCall(this);
606
607
 
607
608
  this.camera.dispose();
@@ -798,7 +799,9 @@ export class Call {
798
799
  *
799
800
  * @param reason the reason for rejecting the call.
800
801
  */
801
- reject = async (reason?: RejectReason): Promise<RejectCallResponse> => {
802
+ reject = async (
803
+ reason: RejectReason = 'decline',
804
+ ): Promise<RejectCallResponse> => {
802
805
  return this.streamClient.post<RejectCallResponse, RejectCallRequest>(
803
806
  `${this.streamClientBasePath}/reject`,
804
807
  { reason: reason },
@@ -188,5 +188,5 @@ export type ClientAppIdentifier = {
188
188
  export type TokenProvider = () => Promise<string>;
189
189
  export type TokenOrProvider = null | string | TokenProvider | undefined;
190
190
 
191
- export type BuiltInRejectReason = 'busy' | 'decline' | 'cancel';
192
- export type RejectReason = BuiltInRejectReason | string;
191
+ export type BuiltInRejectReason = 'busy' | 'decline' | 'cancel' | 'timeout';
192
+ export type RejectReason = BuiltInRejectReason | (string & {});
@@ -174,7 +174,7 @@ export abstract class BasePeerConnection {
174
174
  return;
175
175
  }
176
176
 
177
- const iceCandidate = this.toJSON(candidate);
177
+ const iceCandidate = this.asJSON(candidate);
178
178
  this.sfuClient
179
179
  .iceTrickle({ peerType: this.peerType, iceCandidate })
180
180
  .catch((err) => {
@@ -186,7 +186,7 @@ export abstract class BasePeerConnection {
186
186
  /**
187
187
  * Converts the ICE candidate to a JSON string.
188
188
  */
189
- private toJSON = (candidate: RTCIceCandidate): string => {
189
+ private asJSON = (candidate: RTCIceCandidate): string => {
190
190
  if (!candidate.usernameFragment) {
191
191
  // react-native-webrtc doesn't include usernameFragment in the candidate
192
192
  const segments = candidate.candidate.split(' ');