@stream-io/video-client 1.36.1 → 1.37.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 +12 -0
- package/dist/index.browser.es.js +29 -22
- package/dist/index.browser.es.js.map +1 -1
- package/dist/index.cjs.js +29 -22
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +29 -22
- package/dist/index.es.js.map +1 -1
- package/dist/src/Call.d.ts +6 -4
- package/dist/src/gen/coordinator/index.d.ts +726 -16
- package/dist/src/store/CallState.d.ts +9 -0
- package/package.json +1 -1
- package/src/Call.ts +12 -5
- package/src/StreamVideoClient.ts +2 -9
- package/src/__tests__/StreamVideoClient.api.test.ts +5 -19
- package/src/__tests__/StreamVideoClient.ringing.test.ts +55 -6
- package/src/gen/coordinator/index.ts +708 -16
- package/src/helpers/DynascaleManager.ts +9 -3
- package/src/store/CallState.ts +12 -0
package/dist/index.es.js
CHANGED
|
@@ -53,7 +53,6 @@ const FrameRecordingSettingsRequestQualityEnum = {
|
|
|
53
53
|
_720P: '720p',
|
|
54
54
|
_1080P: '1080p',
|
|
55
55
|
_1440P: '1440p',
|
|
56
|
-
_2160P: '2160p',
|
|
57
56
|
};
|
|
58
57
|
/**
|
|
59
58
|
* @export
|
|
@@ -149,13 +148,11 @@ const RTMPBroadcastRequestQualityEnum = {
|
|
|
149
148
|
_720P: '720p',
|
|
150
149
|
_1080P: '1080p',
|
|
151
150
|
_1440P: '1440p',
|
|
152
|
-
_2160P: '2160p',
|
|
153
151
|
PORTRAIT_360X640: 'portrait-360x640',
|
|
154
152
|
PORTRAIT_480X854: 'portrait-480x854',
|
|
155
153
|
PORTRAIT_720X1280: 'portrait-720x1280',
|
|
156
154
|
PORTRAIT_1080X1920: 'portrait-1080x1920',
|
|
157
155
|
PORTRAIT_1440X2560: 'portrait-1440x2560',
|
|
158
|
-
PORTRAIT_2160X3840: 'portrait-2160x3840',
|
|
159
156
|
};
|
|
160
157
|
/**
|
|
161
158
|
* @export
|
|
@@ -166,13 +163,11 @@ const RTMPSettingsRequestQualityEnum = {
|
|
|
166
163
|
_720P: '720p',
|
|
167
164
|
_1080P: '1080p',
|
|
168
165
|
_1440P: '1440p',
|
|
169
|
-
_2160P: '2160p',
|
|
170
166
|
PORTRAIT_360X640: 'portrait-360x640',
|
|
171
167
|
PORTRAIT_480X854: 'portrait-480x854',
|
|
172
168
|
PORTRAIT_720X1280: 'portrait-720x1280',
|
|
173
169
|
PORTRAIT_1080X1920: 'portrait-1080x1920',
|
|
174
170
|
PORTRAIT_1440X2560: 'portrait-1440x2560',
|
|
175
|
-
PORTRAIT_2160X3840: 'portrait-2160x3840',
|
|
176
171
|
};
|
|
177
172
|
/**
|
|
178
173
|
* @export
|
|
@@ -191,13 +186,11 @@ const RecordSettingsRequestQualityEnum = {
|
|
|
191
186
|
_720P: '720p',
|
|
192
187
|
_1080P: '1080p',
|
|
193
188
|
_1440P: '1440p',
|
|
194
|
-
_2160P: '2160p',
|
|
195
189
|
PORTRAIT_360X640: 'portrait-360x640',
|
|
196
190
|
PORTRAIT_480X854: 'portrait-480x854',
|
|
197
191
|
PORTRAIT_720X1280: 'portrait-720x1280',
|
|
198
192
|
PORTRAIT_1080X1920: 'portrait-1080x1920',
|
|
199
193
|
PORTRAIT_1440X2560: 'portrait-1440x2560',
|
|
200
|
-
PORTRAIT_2160X3840: 'portrait-2160x3840',
|
|
201
194
|
};
|
|
202
195
|
/**
|
|
203
196
|
* @export
|
|
@@ -4998,6 +4991,17 @@ class CallState {
|
|
|
4998
4991
|
this.setAnonymousParticipantCount = (count) => {
|
|
4999
4992
|
return this.setCurrentValue(this.anonymousParticipantCountSubject, count);
|
|
5000
4993
|
};
|
|
4994
|
+
/**
|
|
4995
|
+
* Returns the current participants array directly from the BehaviorSubject.
|
|
4996
|
+
* This bypasses the observable pipeline and is guaranteed to be synchronous.
|
|
4997
|
+
* Use this when you need the absolute latest value without any potential
|
|
4998
|
+
* timing issues from shareReplay/refCount.
|
|
4999
|
+
*
|
|
5000
|
+
* @internal
|
|
5001
|
+
*/
|
|
5002
|
+
this.getParticipantsSnapshot = () => {
|
|
5003
|
+
return this.participantsSubject.getValue();
|
|
5004
|
+
};
|
|
5001
5005
|
/**
|
|
5002
5006
|
* Sets the list of participants in the current call.
|
|
5003
5007
|
*
|
|
@@ -5977,7 +5981,7 @@ const getSdkVersion = (sdk) => {
|
|
|
5977
5981
|
return sdk ? `${sdk.major}.${sdk.minor}.${sdk.patch}` : '0.0.0-development';
|
|
5978
5982
|
};
|
|
5979
5983
|
|
|
5980
|
-
const version = "1.
|
|
5984
|
+
const version = "1.37.1";
|
|
5981
5985
|
const [major, minor, patch] = version.split('.');
|
|
5982
5986
|
let sdkInfo = {
|
|
5983
5987
|
type: SdkType.PLAIN_JAVASCRIPT,
|
|
@@ -9454,13 +9458,19 @@ class DynascaleManager {
|
|
|
9454
9458
|
}
|
|
9455
9459
|
get trackSubscriptions() {
|
|
9456
9460
|
const subscriptions = [];
|
|
9457
|
-
|
|
9461
|
+
// Use getParticipantsSnapshot() to bypass the observable pipeline
|
|
9462
|
+
// and avoid stale data caused by shareReplay with no active subscribers
|
|
9463
|
+
const participants = this.callState.getParticipantsSnapshot();
|
|
9464
|
+
const videoTrackSubscriptionOverrides = this.videoTrackSubscriptionOverridesSubject.getValue();
|
|
9465
|
+
for (const p of participants) {
|
|
9466
|
+
if (p.isLocalParticipant)
|
|
9467
|
+
continue;
|
|
9458
9468
|
// NOTE: audio tracks don't have to be requested explicitly
|
|
9459
9469
|
// as the SFU will implicitly subscribe us to all of them,
|
|
9460
9470
|
// once they become available.
|
|
9461
9471
|
if (p.videoDimension && hasVideo(p)) {
|
|
9462
|
-
const override =
|
|
9463
|
-
|
|
9472
|
+
const override = videoTrackSubscriptionOverrides[p.sessionId] ??
|
|
9473
|
+
videoTrackSubscriptionOverrides[globalOverrideKey];
|
|
9464
9474
|
if (override?.enabled !== false) {
|
|
9465
9475
|
subscriptions.push({
|
|
9466
9476
|
userId: p.userId,
|
|
@@ -12106,6 +12116,7 @@ class Call {
|
|
|
12106
12116
|
* @param params.ring if set to true, a `call.ring` event will be sent to the call members.
|
|
12107
12117
|
* @param params.notify if set to true, a `call.notification` event will be sent to the call members.
|
|
12108
12118
|
* @param params.members_limit the total number of members to return as part of the response.
|
|
12119
|
+
* @param params.video if set to true, in a ringing scenario, mobile SDKs will show "incoming video call", audio only otherwise.
|
|
12109
12120
|
*/
|
|
12110
12121
|
this.get = async (params) => {
|
|
12111
12122
|
await this.setup();
|
|
@@ -12159,11 +12170,11 @@ class Call {
|
|
|
12159
12170
|
return this.streamClient.post(`${this.streamClientBasePath}/delete`, data);
|
|
12160
12171
|
};
|
|
12161
12172
|
/**
|
|
12162
|
-
*
|
|
12163
|
-
*
|
|
12173
|
+
* Sends a ring notification to the provided users who are not already in the call.
|
|
12174
|
+
* All users should be members of the call.
|
|
12164
12175
|
*/
|
|
12165
|
-
this.ring = async () => {
|
|
12166
|
-
return
|
|
12176
|
+
this.ring = async (data = {}) => {
|
|
12177
|
+
return this.streamClient.post(`${this.streamClientBasePath}/ring`, data);
|
|
12167
12178
|
};
|
|
12168
12179
|
/**
|
|
12169
12180
|
* A shortcut for {@link Call.get} with `notify` parameter set to `true`.
|
|
@@ -14878,7 +14889,7 @@ class StreamClient {
|
|
|
14878
14889
|
this.getUserAgent = () => {
|
|
14879
14890
|
if (!this.cachedUserAgent) {
|
|
14880
14891
|
const { clientAppIdentifier = {} } = this.options;
|
|
14881
|
-
const { sdkName = 'js', sdkVersion = "1.
|
|
14892
|
+
const { sdkName = 'js', sdkVersion = "1.37.1", ...extras } = clientAppIdentifier;
|
|
14882
14893
|
this.cachedUserAgent = [
|
|
14883
14894
|
`stream-video-${sdkName}-v${sdkVersion}`,
|
|
14884
14895
|
...Object.entries(extras).map(([key, value]) => `${key}=${value}`),
|
|
@@ -15098,10 +15109,6 @@ class StreamVideoClient {
|
|
|
15098
15109
|
* @param e the event.
|
|
15099
15110
|
*/
|
|
15100
15111
|
this.initCallFromEvent = async (e) => {
|
|
15101
|
-
if (this.state.connectedUser?.id === e.call.created_by.id) {
|
|
15102
|
-
this.logger.debug(`Ignoring ${e.type} event sent by the current user`);
|
|
15103
|
-
return;
|
|
15104
|
-
}
|
|
15105
15112
|
try {
|
|
15106
15113
|
const concurrencyTag = getCallInitConcurrencyTag(e.call_cid);
|
|
15107
15114
|
await withoutConcurrency(concurrencyTag, async () => {
|
|
@@ -15415,12 +15422,12 @@ class StreamVideoClient {
|
|
|
15415
15422
|
this.shouldRejectCall = (currentCallId) => {
|
|
15416
15423
|
if (!this.rejectCallWhenBusy)
|
|
15417
15424
|
return false;
|
|
15418
|
-
|
|
15425
|
+
return this.state.calls.some((c) => c.cid !== currentCallId &&
|
|
15419
15426
|
c.ringing &&
|
|
15427
|
+
!c.isCreatedByMe &&
|
|
15420
15428
|
c.state.callingState !== CallingState.IDLE &&
|
|
15421
15429
|
c.state.callingState !== CallingState.LEFT &&
|
|
15422
15430
|
c.state.callingState !== CallingState.RECONNECTING_FAILED);
|
|
15423
|
-
return hasOngoingRingingCall;
|
|
15424
15431
|
};
|
|
15425
15432
|
const apiKey = typeof apiKeyOrArgs === 'string' ? apiKeyOrArgs : apiKeyOrArgs.apiKey;
|
|
15426
15433
|
const clientOptions = typeof apiKeyOrArgs === 'string' ? opts : apiKeyOrArgs.options;
|