@stream-io/video-client 1.11.0 → 1.11.2
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/CHANGELOG.md +14 -0
- package/dist/index.browser.es.js +17 -16
- package/dist/index.browser.es.js.map +1 -1
- package/dist/index.cjs.js +17 -16
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +17 -16
- package/dist/index.es.js.map +1 -1
- package/package.json +1 -1
- package/src/Call.ts +14 -16
- package/src/__tests__/StreamVideoClient.test.ts +9 -0
- package/src/coordinator/connection/token_manager.ts +2 -0
package/dist/index.es.js
CHANGED
|
@@ -3336,7 +3336,7 @@ const retryable = async (rpc, signal) => {
|
|
|
3336
3336
|
return result;
|
|
3337
3337
|
};
|
|
3338
3338
|
|
|
3339
|
-
const version = "1.11.
|
|
3339
|
+
const version = "1.11.2";
|
|
3340
3340
|
const [major, minor, patch] = version.split('.');
|
|
3341
3341
|
let sdkInfo = {
|
|
3342
3342
|
type: SdkType.PLAIN_JAVASCRIPT,
|
|
@@ -9892,19 +9892,16 @@ class Call {
|
|
|
9892
9892
|
};
|
|
9893
9893
|
await waitUntilCallJoined();
|
|
9894
9894
|
}
|
|
9895
|
-
if (
|
|
9896
|
-
|
|
9897
|
-
|
|
9898
|
-
if (this.isCreatedByMe &&
|
|
9899
|
-
!hasOtherParticipants &&
|
|
9900
|
-
callingState === CallingState.RINGING) {
|
|
9901
|
-
// Signals other users that I have cancelled my call to them
|
|
9902
|
-
// before they accepted it.
|
|
9903
|
-
await this.reject();
|
|
9895
|
+
if (callingState === CallingState.RINGING) {
|
|
9896
|
+
if (reject) {
|
|
9897
|
+
await this.reject(reason);
|
|
9904
9898
|
}
|
|
9905
|
-
else
|
|
9906
|
-
|
|
9907
|
-
|
|
9899
|
+
else {
|
|
9900
|
+
const hasOtherParticipants = this.state.remoteParticipants.length > 0;
|
|
9901
|
+
if (this.isCreatedByMe && !hasOtherParticipants) {
|
|
9902
|
+
// I'm the one who started the call, so I should cancel it when there are no other participants.
|
|
9903
|
+
await this.reject('cancel');
|
|
9904
|
+
}
|
|
9908
9905
|
}
|
|
9909
9906
|
}
|
|
9910
9907
|
this.statsReporter?.stop();
|
|
@@ -11015,13 +11012,15 @@ class Call {
|
|
|
11015
11012
|
// ignore if the call is not ringing
|
|
11016
11013
|
if (this.state.callingState !== CallingState.RINGING)
|
|
11017
11014
|
return;
|
|
11018
|
-
const timeoutInMs =
|
|
11015
|
+
const timeoutInMs = this.isCreatedByMe
|
|
11016
|
+
? settings.ring.auto_cancel_timeout_ms
|
|
11017
|
+
: settings.ring.incoming_call_timeout_ms;
|
|
11019
11018
|
// 0 means no auto-drop
|
|
11020
11019
|
if (timeoutInMs <= 0)
|
|
11021
11020
|
return;
|
|
11022
11021
|
clearTimeout(this.dropTimeout);
|
|
11023
11022
|
this.dropTimeout = setTimeout(() => {
|
|
11024
|
-
this.leave({ reason: '
|
|
11023
|
+
this.leave({ reject: true, reason: 'timeout' }).catch((err) => {
|
|
11025
11024
|
this.logger('error', 'Failed to drop call', err);
|
|
11026
11025
|
});
|
|
11027
11026
|
}, timeoutInMs);
|
|
@@ -12216,6 +12215,8 @@ class TokenManager {
|
|
|
12216
12215
|
*/
|
|
12217
12216
|
this.reset = () => {
|
|
12218
12217
|
this.token = undefined;
|
|
12218
|
+
this.tokenProvider = undefined;
|
|
12219
|
+
this.type = 'static';
|
|
12219
12220
|
this.user = undefined;
|
|
12220
12221
|
this.loadTokenPromise = null;
|
|
12221
12222
|
};
|
|
@@ -12976,7 +12977,7 @@ class StreamClient {
|
|
|
12976
12977
|
});
|
|
12977
12978
|
};
|
|
12978
12979
|
this.getUserAgent = () => {
|
|
12979
|
-
const version = "1.11.
|
|
12980
|
+
const version = "1.11.2";
|
|
12980
12981
|
return (this.userAgent ||
|
|
12981
12982
|
`stream-video-javascript-client-${this.node ? 'node' : 'browser'}-${version}`);
|
|
12982
12983
|
};
|