@stream-io/video-client 0.0.26 → 0.0.28
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 +13 -5
- package/dist/index.browser.es.js.map +1 -1
- package/dist/index.cjs.js +13 -5
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +13 -5
- package/dist/index.es.js.map +1 -1
- package/dist/src/Call.d.ts +5 -5
- package/package.json +1 -1
- package/src/Call.ts +15 -5
- package/src/StreamVideoClient.ts +7 -0
- package/src/coordinator/connection/client.ts +0 -1
- package/src/store/stateStore.ts +5 -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.28](https://github.com/GetStream/stream-video-js/compare/client0.0.27...client0.0.28) (2023-06-29)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
* Change sendEvent signature ([#734](https://github.com/GetStream/stream-video-js/issues/734)) ([284c8c2](https://github.com/GetStream/stream-video-js/commit/284c8c2165129852ccf9fd7d8baad37f43d22a17))
|
|
11
|
+
|
|
12
|
+
### [0.0.27](https://github.com/GetStream/stream-video-js/compare/client0.0.26...client0.0.27) (2023-06-27)
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
### Documentation
|
|
16
|
+
|
|
17
|
+
* Tutorial rewrite ([#709](https://github.com/GetStream/stream-video-js/issues/709)) ([9a14188](https://github.com/GetStream/stream-video-js/commit/9a141883ec2e402e7130c7e41f464439d5cb2800))
|
|
18
|
+
|
|
5
19
|
### [0.0.26](https://github.com/GetStream/stream-video-js/compare/client0.0.25...client0.0.26) (2023-06-23)
|
|
6
20
|
|
|
7
21
|
|
package/dist/index.browser.es.js
CHANGED
|
@@ -6502,6 +6502,7 @@ class StreamVideoWriteableStateStore {
|
|
|
6502
6502
|
// leave all calls when the user disconnects.
|
|
6503
6503
|
if (!user) {
|
|
6504
6504
|
for (const call of this.calls) {
|
|
6505
|
+
getLogger(['client-state'])('info', `User disconnected, leaving call: ${call.cid}`);
|
|
6505
6506
|
yield call.leave();
|
|
6506
6507
|
}
|
|
6507
6508
|
}
|
|
@@ -8552,6 +8553,7 @@ class Call {
|
|
|
8552
8553
|
this.join = (data) => __awaiter(this, void 0, void 0, function* () {
|
|
8553
8554
|
var _e, _f;
|
|
8554
8555
|
if ([CallingState.JOINED, CallingState.JOINING].includes(this.state.callingState)) {
|
|
8556
|
+
this.logger('warn', 'Join method called twice, you should only call this once');
|
|
8555
8557
|
throw new Error(`Illegal State: Already joined.`);
|
|
8556
8558
|
}
|
|
8557
8559
|
if (this.state.callingState === CallingState.LEFT) {
|
|
@@ -8559,6 +8561,7 @@ class Call {
|
|
|
8559
8561
|
}
|
|
8560
8562
|
const previousCallingState = this.state.callingState;
|
|
8561
8563
|
this.state.setCallingState(CallingState.JOINING);
|
|
8564
|
+
this.logger('debug', 'Starting join flow');
|
|
8562
8565
|
if ((data === null || data === void 0 ? void 0 : data.ring) && !this.ringing) {
|
|
8563
8566
|
this.ringingSubject.next(true);
|
|
8564
8567
|
}
|
|
@@ -8796,6 +8799,7 @@ class Call {
|
|
|
8796
8799
|
// otherwise we risk breaking the ICETrickle flow.
|
|
8797
8800
|
yield this.assertCallJoined();
|
|
8798
8801
|
if (!this.publisher) {
|
|
8802
|
+
this.logger('error', 'Trying to publish video before join is completed');
|
|
8799
8803
|
throw new Error(`Call not joined yet.`);
|
|
8800
8804
|
}
|
|
8801
8805
|
const [videoTrack] = videoStream.getVideoTracks();
|
|
@@ -8820,6 +8824,7 @@ class Call {
|
|
|
8820
8824
|
// otherwise we risk breaking the ICETrickle flow.
|
|
8821
8825
|
yield this.assertCallJoined();
|
|
8822
8826
|
if (!this.publisher) {
|
|
8827
|
+
this.logger('error', 'Trying to publish audio before join is completed');
|
|
8823
8828
|
throw new Error(`Call not joined yet.`);
|
|
8824
8829
|
}
|
|
8825
8830
|
const [audioTrack] = audioStream.getAudioTracks();
|
|
@@ -8843,6 +8848,7 @@ class Call {
|
|
|
8843
8848
|
// otherwise we risk breaking the ICETrickle flow.
|
|
8844
8849
|
yield this.assertCallJoined();
|
|
8845
8850
|
if (!this.publisher) {
|
|
8851
|
+
this.logger('error', 'Trying to publish screen share before join is completed');
|
|
8846
8852
|
throw new Error(`Call not joined yet.`);
|
|
8847
8853
|
}
|
|
8848
8854
|
const [screenShareTrack] = screenShareStream.getVideoTracks();
|
|
@@ -9326,12 +9332,12 @@ class Call {
|
|
|
9326
9332
|
return response;
|
|
9327
9333
|
});
|
|
9328
9334
|
/**
|
|
9329
|
-
* Sends
|
|
9335
|
+
* Sends a custom event to all call participants.
|
|
9330
9336
|
*
|
|
9331
9337
|
* @param event the event to send.
|
|
9332
9338
|
*/
|
|
9333
|
-
this.
|
|
9334
|
-
return this.streamClient.post(`${this.streamClientBasePath}/event`,
|
|
9339
|
+
this.sendCustomEvent = (payload) => __awaiter(this, void 0, void 0, function* () {
|
|
9340
|
+
return this.streamClient.post(`${this.streamClientBasePath}/event`, { custom: payload });
|
|
9335
9341
|
});
|
|
9336
9342
|
this.type = type;
|
|
9337
9343
|
this.id = id;
|
|
@@ -9391,6 +9397,7 @@ class Call {
|
|
|
9391
9397
|
const currentUserId = this.currentUserId;
|
|
9392
9398
|
if (currentUserId &&
|
|
9393
9399
|
metadata.blocked_user_ids.includes(currentUserId)) {
|
|
9400
|
+
this.logger('info', 'Leaving call bacause of being blocked');
|
|
9394
9401
|
yield this.leave();
|
|
9395
9402
|
}
|
|
9396
9403
|
})),
|
|
@@ -10938,7 +10945,6 @@ class StreamClient {
|
|
|
10938
10945
|
if (!(key in this.listeners)) {
|
|
10939
10946
|
this.listeners[key] = [];
|
|
10940
10947
|
}
|
|
10941
|
-
this.logger('info', `Attaching listener for ${key} event`);
|
|
10942
10948
|
this.listeners[key].push(callback);
|
|
10943
10949
|
return () => {
|
|
10944
10950
|
this.off(key, callback);
|
|
@@ -11098,7 +11104,7 @@ class StreamClient {
|
|
|
11098
11104
|
}
|
|
11099
11105
|
getUserAgent() {
|
|
11100
11106
|
return (this.userAgent ||
|
|
11101
|
-
`stream-video-javascript-client-${this.node ? 'node' : 'browser'}-${"0.0.
|
|
11107
|
+
`stream-video-javascript-client-${this.node ? 'node' : 'browser'}-${"0.0.27"}`);
|
|
11102
11108
|
}
|
|
11103
11109
|
setUserAgent(userAgent) {
|
|
11104
11110
|
this.userAgent = userAgent;
|
|
@@ -11409,6 +11415,7 @@ class StreamVideoClient {
|
|
|
11409
11415
|
const callsToReWatch = this.writeableStateStore.calls
|
|
11410
11416
|
.filter((call) => call.watching)
|
|
11411
11417
|
.map((call) => call.cid);
|
|
11418
|
+
this.logger('info', `Rewatching calls after connection changed ${callsToReWatch.join(', ')}`);
|
|
11412
11419
|
if (callsToReWatch.length > 0) {
|
|
11413
11420
|
this.queryCalls({
|
|
11414
11421
|
watch: true,
|
|
@@ -11430,6 +11437,7 @@ class StreamVideoClient {
|
|
|
11430
11437
|
this.logger('warn', 'Received `call.created` sent by the current user');
|
|
11431
11438
|
return;
|
|
11432
11439
|
}
|
|
11440
|
+
this.logger('info', `New call created and registered: ${call.cid}`);
|
|
11433
11441
|
this.writeableStateStore.registerCall(new Call({
|
|
11434
11442
|
streamClient: this.streamClient,
|
|
11435
11443
|
type: call.type,
|