@stream-io/video-client 1.11.0 → 1.11.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/CHANGELOG.md +7 -0
- package/dist/index.browser.es.js +15 -16
- package/dist/index.browser.es.js.map +1 -1
- package/dist/index.cjs.js +15 -16
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +15 -16
- package/dist/index.es.js.map +1 -1
- package/package.json +1 -1
- package/src/Call.ts +14 -16
package/package.json
CHANGED
package/src/Call.ts
CHANGED
|
@@ -516,20 +516,15 @@ export class Call {
|
|
|
516
516
|
await waitUntilCallJoined();
|
|
517
517
|
}
|
|
518
518
|
|
|
519
|
-
if (
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
this.
|
|
524
|
-
!hasOtherParticipants
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
// before they accepted it.
|
|
529
|
-
await this.reject();
|
|
530
|
-
} else if (callingState === CallingState.RINGING) {
|
|
531
|
-
// Signals other users that I have rejected the incoming call.
|
|
532
|
-
await this.reject();
|
|
519
|
+
if (callingState === CallingState.RINGING) {
|
|
520
|
+
if (reject) {
|
|
521
|
+
await this.reject(reason);
|
|
522
|
+
} else {
|
|
523
|
+
const hasOtherParticipants = this.state.remoteParticipants.length > 0;
|
|
524
|
+
if (this.isCreatedByMe && !hasOtherParticipants) {
|
|
525
|
+
// I'm the one who started the call, so I should cancel it when there are no other participants.
|
|
526
|
+
await this.reject('cancel');
|
|
527
|
+
}
|
|
533
528
|
}
|
|
534
529
|
}
|
|
535
530
|
|
|
@@ -1960,13 +1955,16 @@ export class Call {
|
|
|
1960
1955
|
// ignore if the call is not ringing
|
|
1961
1956
|
if (this.state.callingState !== CallingState.RINGING) return;
|
|
1962
1957
|
|
|
1963
|
-
const timeoutInMs =
|
|
1958
|
+
const timeoutInMs = this.isCreatedByMe
|
|
1959
|
+
? settings.ring.auto_cancel_timeout_ms
|
|
1960
|
+
: settings.ring.incoming_call_timeout_ms;
|
|
1961
|
+
|
|
1964
1962
|
// 0 means no auto-drop
|
|
1965
1963
|
if (timeoutInMs <= 0) return;
|
|
1966
1964
|
|
|
1967
1965
|
clearTimeout(this.dropTimeout);
|
|
1968
1966
|
this.dropTimeout = setTimeout(() => {
|
|
1969
|
-
this.leave({ reason: '
|
|
1967
|
+
this.leave({ reject: true, reason: 'timeout' }).catch((err) => {
|
|
1970
1968
|
this.logger('error', 'Failed to drop call', err);
|
|
1971
1969
|
});
|
|
1972
1970
|
}, timeoutInMs);
|