@stream-io/video-client 0.0.37 → 0.0.39
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 +9 -4
- package/dist/index.browser.es.js.map +1 -1
- package/dist/index.cjs.js +9 -4
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +9 -4
- package/dist/index.es.js.map +1 -1
- package/dist/src/gen/coordinator/index.d.ts +26 -0
- package/package.json +1 -1
- package/src/events/__tests__/sessions.test.ts +5 -0
- package/src/events/sessions.ts +7 -3
- package/src/gen/coordinator/index.ts +26 -0
- package/src/rtc/Publisher.ts +1 -0
package/dist/index.cjs.js
CHANGED
|
@@ -39,12 +39,14 @@ var SDP__namespace = /*#__PURE__*/_interopNamespaceDefault(SDP);
|
|
|
39
39
|
*/
|
|
40
40
|
const AudioSettingsDefaultDeviceEnum = {
|
|
41
41
|
SPEAKER: 'speaker',
|
|
42
|
+
EARPIECE: 'earpiece',
|
|
42
43
|
};
|
|
43
44
|
/**
|
|
44
45
|
* @export
|
|
45
46
|
*/
|
|
46
47
|
const AudioSettingsRequestDefaultDeviceEnum = {
|
|
47
48
|
SPEAKER: 'speaker',
|
|
49
|
+
EARPIECE: 'earpiece',
|
|
48
50
|
};
|
|
49
51
|
/**
|
|
50
52
|
* @export
|
|
@@ -6114,6 +6116,7 @@ class Publisher {
|
|
|
6114
6116
|
this.trackLayersCache[trackType] = undefined;
|
|
6115
6117
|
});
|
|
6116
6118
|
}
|
|
6119
|
+
this.pc.removeEventListener('negotiationneeded', this.onNegotiationNeeded);
|
|
6117
6120
|
this.pc.close();
|
|
6118
6121
|
};
|
|
6119
6122
|
/**
|
|
@@ -8337,7 +8340,7 @@ const watchCallSessionParticipantJoined = (state) => {
|
|
|
8337
8340
|
return function onCallParticipantJoined(event) {
|
|
8338
8341
|
if (event.type !== 'call.session_participant_joined')
|
|
8339
8342
|
return;
|
|
8340
|
-
const { user } = event;
|
|
8343
|
+
const { user, user_session_id } = event;
|
|
8341
8344
|
state.setMetadata((metadata) => {
|
|
8342
8345
|
if (!metadata || !metadata.session) {
|
|
8343
8346
|
state.logger('warn', `Received call.session_participant_joined event but the metadata structure is invalid.`, event);
|
|
@@ -8351,6 +8354,8 @@ const watchCallSessionParticipantJoined = (state) => {
|
|
|
8351
8354
|
// FIXME OL: ideally, this comes from the backend
|
|
8352
8355
|
joined_at: new Date().toISOString(),
|
|
8353
8356
|
user,
|
|
8357
|
+
role: user.role,
|
|
8358
|
+
user_session_id,
|
|
8354
8359
|
},
|
|
8355
8360
|
], participants_count_by_role: Object.assign(Object.assign({}, participants_count_by_role), { [user.role]: (participants_count_by_role[user.role] || 0) + 1 }) }) });
|
|
8356
8361
|
});
|
|
@@ -8365,7 +8370,7 @@ const watchCallSessionParticipantLeft = (state) => {
|
|
|
8365
8370
|
return function onCallParticipantLeft(event) {
|
|
8366
8371
|
if (event.type !== 'call.session_participant_left')
|
|
8367
8372
|
return;
|
|
8368
|
-
const { user } = event;
|
|
8373
|
+
const { user, user_session_id } = event;
|
|
8369
8374
|
state.setMetadata((metadata) => {
|
|
8370
8375
|
if (!metadata || !metadata.session) {
|
|
8371
8376
|
state.logger('warn', `Received call.session_participant_left event but the metadata structure is invalid.`, event);
|
|
@@ -8373,7 +8378,7 @@ const watchCallSessionParticipantLeft = (state) => {
|
|
|
8373
8378
|
}
|
|
8374
8379
|
const { session } = metadata;
|
|
8375
8380
|
const { participants, participants_count_by_role } = session;
|
|
8376
|
-
return Object.assign(Object.assign({}, metadata), { session: Object.assign(Object.assign({}, session), { participants: participants.filter((p) => p.
|
|
8381
|
+
return Object.assign(Object.assign({}, metadata), { session: Object.assign(Object.assign({}, session), { participants: participants.filter((p) => p.user_session_id !== user_session_id), participants_count_by_role: Object.assign(Object.assign({}, participants_count_by_role), { [user.role]: Math.max(0, (participants_count_by_role[user.role] || 0) - 1) }) }) });
|
|
8377
8382
|
});
|
|
8378
8383
|
};
|
|
8379
8384
|
};
|
|
@@ -11834,7 +11839,7 @@ class StreamClient {
|
|
|
11834
11839
|
}
|
|
11835
11840
|
getUserAgent() {
|
|
11836
11841
|
return (this.userAgent ||
|
|
11837
|
-
`stream-video-javascript-client-${this.node ? 'node' : 'browser'}-${"0.0.
|
|
11842
|
+
`stream-video-javascript-client-${this.node ? 'node' : 'browser'}-${"0.0.38"}`);
|
|
11838
11843
|
}
|
|
11839
11844
|
setUserAgent(userAgent) {
|
|
11840
11845
|
this.userAgent = userAgent;
|