@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/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,20 @@
|
|
|
2
2
|
|
|
3
3
|
This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
|
|
4
4
|
|
|
5
|
+
### [0.0.39](https://github.com/GetStream/stream-video-js/compare/client0.0.38...client0.0.39) (2023-07-07)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
* promise rejection on call leave ([#767](https://github.com/GetStream/stream-video-js/issues/767)) ([4b9fb95](https://github.com/GetStream/stream-video-js/commit/4b9fb959649126594855a1699058da907d7b5832))
|
|
11
|
+
|
|
12
|
+
### [0.0.38](https://github.com/GetStream/stream-video-js/compare/client0.0.37...client0.0.38) (2023-07-07)
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
### Features
|
|
16
|
+
|
|
17
|
+
* 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))
|
|
18
|
+
|
|
5
19
|
### [0.0.37](https://github.com/GetStream/stream-video-js/compare/client0.0.36...client0.0.37) (2023-07-06)
|
|
6
20
|
|
|
7
21
|
|
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
|
|
@@ -6091,6 +6093,7 @@ class Publisher {
|
|
|
6091
6093
|
this.trackLayersCache[trackType] = undefined;
|
|
6092
6094
|
});
|
|
6093
6095
|
}
|
|
6096
|
+
this.pc.removeEventListener('negotiationneeded', this.onNegotiationNeeded);
|
|
6094
6097
|
this.pc.close();
|
|
6095
6098
|
};
|
|
6096
6099
|
/**
|
|
@@ -8314,7 +8317,7 @@ const watchCallSessionParticipantJoined = (state) => {
|
|
|
8314
8317
|
return function onCallParticipantJoined(event) {
|
|
8315
8318
|
if (event.type !== 'call.session_participant_joined')
|
|
8316
8319
|
return;
|
|
8317
|
-
const { user } = event;
|
|
8320
|
+
const { user, user_session_id } = event;
|
|
8318
8321
|
state.setMetadata((metadata) => {
|
|
8319
8322
|
if (!metadata || !metadata.session) {
|
|
8320
8323
|
state.logger('warn', `Received call.session_participant_joined event but the metadata structure is invalid.`, event);
|
|
@@ -8328,6 +8331,8 @@ const watchCallSessionParticipantJoined = (state) => {
|
|
|
8328
8331
|
// FIXME OL: ideally, this comes from the backend
|
|
8329
8332
|
joined_at: new Date().toISOString(),
|
|
8330
8333
|
user,
|
|
8334
|
+
role: user.role,
|
|
8335
|
+
user_session_id,
|
|
8331
8336
|
},
|
|
8332
8337
|
], participants_count_by_role: Object.assign(Object.assign({}, participants_count_by_role), { [user.role]: (participants_count_by_role[user.role] || 0) + 1 }) }) });
|
|
8333
8338
|
});
|
|
@@ -8342,7 +8347,7 @@ const watchCallSessionParticipantLeft = (state) => {
|
|
|
8342
8347
|
return function onCallParticipantLeft(event) {
|
|
8343
8348
|
if (event.type !== 'call.session_participant_left')
|
|
8344
8349
|
return;
|
|
8345
|
-
const { user } = event;
|
|
8350
|
+
const { user, user_session_id } = event;
|
|
8346
8351
|
state.setMetadata((metadata) => {
|
|
8347
8352
|
if (!metadata || !metadata.session) {
|
|
8348
8353
|
state.logger('warn', `Received call.session_participant_left event but the metadata structure is invalid.`, event);
|
|
@@ -8350,7 +8355,7 @@ const watchCallSessionParticipantLeft = (state) => {
|
|
|
8350
8355
|
}
|
|
8351
8356
|
const { session } = metadata;
|
|
8352
8357
|
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.
|
|
8358
|
+
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
8359
|
});
|
|
8355
8360
|
};
|
|
8356
8361
|
};
|
|
@@ -11810,7 +11815,7 @@ class StreamClient {
|
|
|
11810
11815
|
}
|
|
11811
11816
|
getUserAgent() {
|
|
11812
11817
|
return (this.userAgent ||
|
|
11813
|
-
`stream-video-javascript-client-${this.node ? 'node' : 'browser'}-${"0.0.
|
|
11818
|
+
`stream-video-javascript-client-${this.node ? 'node' : 'browser'}-${"0.0.38"}`);
|
|
11814
11819
|
}
|
|
11815
11820
|
setUserAgent(userAgent) {
|
|
11816
11821
|
this.userAgent = userAgent;
|