@stream-io/video-client 0.0.37 → 0.0.38
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 +8 -4
- package/dist/index.browser.es.js.map +1 -1
- package/dist/index.cjs.js +8 -4
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +8 -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/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
|
|
4
4
|
|
|
5
|
+
### [0.0.38](https://github.com/GetStream/stream-video-js/compare/client0.0.37...client0.0.38) (2023-07-07)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
* respect user_session_id in call.session events ([#766](https://github.com/GetStream/stream-video-js/issues/766)) ([18c6ae0](https://github.com/GetStream/stream-video-js/commit/18c6ae0ea47060e18b3462c7a6a04cad59f5f94b))
|
|
11
|
+
|
|
5
12
|
### [0.0.37](https://github.com/GetStream/stream-video-js/compare/client0.0.36...client0.0.37) (2023-07-06)
|
|
6
13
|
|
|
7
14
|
|
package/dist/index.browser.es.js
CHANGED
|
@@ -16,12 +16,14 @@ import { fromByteArray } from 'base64-js';
|
|
|
16
16
|
*/
|
|
17
17
|
const AudioSettingsDefaultDeviceEnum = {
|
|
18
18
|
SPEAKER: 'speaker',
|
|
19
|
+
EARPIECE: 'earpiece',
|
|
19
20
|
};
|
|
20
21
|
/**
|
|
21
22
|
* @export
|
|
22
23
|
*/
|
|
23
24
|
const AudioSettingsRequestDefaultDeviceEnum = {
|
|
24
25
|
SPEAKER: 'speaker',
|
|
26
|
+
EARPIECE: 'earpiece',
|
|
25
27
|
};
|
|
26
28
|
/**
|
|
27
29
|
* @export
|
|
@@ -8314,7 +8316,7 @@ const watchCallSessionParticipantJoined = (state) => {
|
|
|
8314
8316
|
return function onCallParticipantJoined(event) {
|
|
8315
8317
|
if (event.type !== 'call.session_participant_joined')
|
|
8316
8318
|
return;
|
|
8317
|
-
const { user } = event;
|
|
8319
|
+
const { user, user_session_id } = event;
|
|
8318
8320
|
state.setMetadata((metadata) => {
|
|
8319
8321
|
if (!metadata || !metadata.session) {
|
|
8320
8322
|
state.logger('warn', `Received call.session_participant_joined event but the metadata structure is invalid.`, event);
|
|
@@ -8328,6 +8330,8 @@ const watchCallSessionParticipantJoined = (state) => {
|
|
|
8328
8330
|
// FIXME OL: ideally, this comes from the backend
|
|
8329
8331
|
joined_at: new Date().toISOString(),
|
|
8330
8332
|
user,
|
|
8333
|
+
role: user.role,
|
|
8334
|
+
user_session_id,
|
|
8331
8335
|
},
|
|
8332
8336
|
], participants_count_by_role: Object.assign(Object.assign({}, participants_count_by_role), { [user.role]: (participants_count_by_role[user.role] || 0) + 1 }) }) });
|
|
8333
8337
|
});
|
|
@@ -8342,7 +8346,7 @@ const watchCallSessionParticipantLeft = (state) => {
|
|
|
8342
8346
|
return function onCallParticipantLeft(event) {
|
|
8343
8347
|
if (event.type !== 'call.session_participant_left')
|
|
8344
8348
|
return;
|
|
8345
|
-
const { user } = event;
|
|
8349
|
+
const { user, user_session_id } = event;
|
|
8346
8350
|
state.setMetadata((metadata) => {
|
|
8347
8351
|
if (!metadata || !metadata.session) {
|
|
8348
8352
|
state.logger('warn', `Received call.session_participant_left event but the metadata structure is invalid.`, event);
|
|
@@ -8350,7 +8354,7 @@ const watchCallSessionParticipantLeft = (state) => {
|
|
|
8350
8354
|
}
|
|
8351
8355
|
const { session } = metadata;
|
|
8352
8356
|
const { participants, participants_count_by_role } = session;
|
|
8353
|
-
return Object.assign(Object.assign({}, metadata), { session: Object.assign(Object.assign({}, session), { participants: participants.filter((p) => p.
|
|
8357
|
+
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) }) }) });
|
|
8354
8358
|
});
|
|
8355
8359
|
};
|
|
8356
8360
|
};
|
|
@@ -11810,7 +11814,7 @@ class StreamClient {
|
|
|
11810
11814
|
}
|
|
11811
11815
|
getUserAgent() {
|
|
11812
11816
|
return (this.userAgent ||
|
|
11813
|
-
`stream-video-javascript-client-${this.node ? 'node' : 'browser'}-${"0.0.
|
|
11817
|
+
`stream-video-javascript-client-${this.node ? 'node' : 'browser'}-${"0.0.37"}`);
|
|
11814
11818
|
}
|
|
11815
11819
|
setUserAgent(userAgent) {
|
|
11816
11820
|
this.userAgent = userAgent;
|