@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.es.js
CHANGED
|
@@ -19,12 +19,14 @@ import { fromByteArray } from 'base64-js';
|
|
|
19
19
|
*/
|
|
20
20
|
const AudioSettingsDefaultDeviceEnum = {
|
|
21
21
|
SPEAKER: 'speaker',
|
|
22
|
+
EARPIECE: 'earpiece',
|
|
22
23
|
};
|
|
23
24
|
/**
|
|
24
25
|
* @export
|
|
25
26
|
*/
|
|
26
27
|
const AudioSettingsRequestDefaultDeviceEnum = {
|
|
27
28
|
SPEAKER: 'speaker',
|
|
29
|
+
EARPIECE: 'earpiece',
|
|
28
30
|
};
|
|
29
31
|
/**
|
|
30
32
|
* @export
|
|
@@ -6094,6 +6096,7 @@ class Publisher {
|
|
|
6094
6096
|
this.trackLayersCache[trackType] = undefined;
|
|
6095
6097
|
});
|
|
6096
6098
|
}
|
|
6099
|
+
this.pc.removeEventListener('negotiationneeded', this.onNegotiationNeeded);
|
|
6097
6100
|
this.pc.close();
|
|
6098
6101
|
};
|
|
6099
6102
|
/**
|
|
@@ -8317,7 +8320,7 @@ const watchCallSessionParticipantJoined = (state) => {
|
|
|
8317
8320
|
return function onCallParticipantJoined(event) {
|
|
8318
8321
|
if (event.type !== 'call.session_participant_joined')
|
|
8319
8322
|
return;
|
|
8320
|
-
const { user } = event;
|
|
8323
|
+
const { user, user_session_id } = event;
|
|
8321
8324
|
state.setMetadata((metadata) => {
|
|
8322
8325
|
if (!metadata || !metadata.session) {
|
|
8323
8326
|
state.logger('warn', `Received call.session_participant_joined event but the metadata structure is invalid.`, event);
|
|
@@ -8331,6 +8334,8 @@ const watchCallSessionParticipantJoined = (state) => {
|
|
|
8331
8334
|
// FIXME OL: ideally, this comes from the backend
|
|
8332
8335
|
joined_at: new Date().toISOString(),
|
|
8333
8336
|
user,
|
|
8337
|
+
role: user.role,
|
|
8338
|
+
user_session_id,
|
|
8334
8339
|
},
|
|
8335
8340
|
], participants_count_by_role: Object.assign(Object.assign({}, participants_count_by_role), { [user.role]: (participants_count_by_role[user.role] || 0) + 1 }) }) });
|
|
8336
8341
|
});
|
|
@@ -8345,7 +8350,7 @@ const watchCallSessionParticipantLeft = (state) => {
|
|
|
8345
8350
|
return function onCallParticipantLeft(event) {
|
|
8346
8351
|
if (event.type !== 'call.session_participant_left')
|
|
8347
8352
|
return;
|
|
8348
|
-
const { user } = event;
|
|
8353
|
+
const { user, user_session_id } = event;
|
|
8349
8354
|
state.setMetadata((metadata) => {
|
|
8350
8355
|
if (!metadata || !metadata.session) {
|
|
8351
8356
|
state.logger('warn', `Received call.session_participant_left event but the metadata structure is invalid.`, event);
|
|
@@ -8353,7 +8358,7 @@ const watchCallSessionParticipantLeft = (state) => {
|
|
|
8353
8358
|
}
|
|
8354
8359
|
const { session } = metadata;
|
|
8355
8360
|
const { participants, participants_count_by_role } = session;
|
|
8356
|
-
return Object.assign(Object.assign({}, metadata), { session: Object.assign(Object.assign({}, session), { participants: participants.filter((p) => p.
|
|
8361
|
+
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) }) }) });
|
|
8357
8362
|
});
|
|
8358
8363
|
};
|
|
8359
8364
|
};
|
|
@@ -11814,7 +11819,7 @@ class StreamClient {
|
|
|
11814
11819
|
}
|
|
11815
11820
|
getUserAgent() {
|
|
11816
11821
|
return (this.userAgent ||
|
|
11817
|
-
`stream-video-javascript-client-${this.node ? 'node' : 'browser'}-${"0.0.
|
|
11822
|
+
`stream-video-javascript-client-${this.node ? 'node' : 'browser'}-${"0.0.38"}`);
|
|
11818
11823
|
}
|
|
11819
11824
|
setUserAgent(userAgent) {
|
|
11820
11825
|
this.userAgent = userAgent;
|