@stream-io/video-client 0.7.4 → 0.7.6
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 -2
- package/dist/index.browser.es.js.map +1 -1
- package/dist/index.cjs.js +13 -2
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +13 -2
- package/dist/index.es.js.map +1 -1
- package/dist/src/Call.d.ts +1 -0
- package/package.json +1 -1
- package/src/Call.ts +6 -0
- package/src/rtc/__tests__/videoLayers.test.ts +20 -0
- package/src/rtc/videoLayers.ts +8 -1
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.7.6](https://github.com/GetStream/stream-video-js/compare/@stream-io/video-client-0.7.5...@stream-io/video-client-0.7.6) (2024-04-23)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
* **client:** ignore SFU WS status code when the user initiates leaving a call ([#1323](https://github.com/GetStream/stream-video-js/issues/1323)) ([774882b](https://github.com/GetStream/stream-video-js/commit/774882b9e2bb3f3dc72401278c174e1a0f597ce1))
|
|
11
|
+
|
|
12
|
+
### [0.7.5](https://github.com/GetStream/stream-video-js/compare/@stream-io/video-client-0.7.4...@stream-io/video-client-0.7.5) (2024-04-23)
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
### Bug Fixes
|
|
16
|
+
|
|
17
|
+
* **publisher:** ensure initial bitrate is set ([#1322](https://github.com/GetStream/stream-video-js/issues/1322)) ([d7e8e4e](https://github.com/GetStream/stream-video-js/commit/d7e8e4e5cb3ff9859c1eb580162ed88bbe54b096))
|
|
18
|
+
|
|
5
19
|
### [0.7.4](https://github.com/GetStream/stream-video-js/compare/@stream-io/video-client-0.7.3...@stream-io/video-client-0.7.4) (2024-04-17)
|
|
6
20
|
|
|
7
21
|
|
package/dist/index.browser.es.js
CHANGED
|
@@ -6096,6 +6096,11 @@ const defaultTargetResolution = {
|
|
|
6096
6096
|
width: 1280,
|
|
6097
6097
|
height: 720,
|
|
6098
6098
|
};
|
|
6099
|
+
const defaultBitratePerRid = {
|
|
6100
|
+
q: 300000,
|
|
6101
|
+
h: 750000,
|
|
6102
|
+
f: DEFAULT_BITRATE,
|
|
6103
|
+
};
|
|
6099
6104
|
/**
|
|
6100
6105
|
* Determines the most optimal video layers for simulcasting
|
|
6101
6106
|
* for the given track.
|
|
@@ -6119,7 +6124,7 @@ const findOptimalVideoLayers = (videoTrack, targetResolution = defaultTargetReso
|
|
|
6119
6124
|
rid,
|
|
6120
6125
|
width: Math.round(w / downscaleFactor),
|
|
6121
6126
|
height: Math.round(h / downscaleFactor),
|
|
6122
|
-
maxBitrate: Math.round(maxBitrate / downscaleFactor),
|
|
6127
|
+
maxBitrate: Math.round(maxBitrate / downscaleFactor) || defaultBitratePerRid[rid],
|
|
6123
6128
|
scaleResolutionDownBy: downscaleFactor,
|
|
6124
6129
|
// Simulcast on iOS React-Native requires all encodings to share the same framerate
|
|
6125
6130
|
maxFramerate: {
|
|
@@ -11482,6 +11487,7 @@ class Call {
|
|
|
11482
11487
|
this.trackSubscriptionsSubject = new BehaviorSubject({ type: DebounceType.MEDIUM, data: [] });
|
|
11483
11488
|
this.reconnectAttempts = 0;
|
|
11484
11489
|
this.maxReconnectAttempts = 10;
|
|
11490
|
+
this.isLeaving = false;
|
|
11485
11491
|
/**
|
|
11486
11492
|
* A list hooks/functions to invoke when the call is left.
|
|
11487
11493
|
* A typical use case is to clean up some global event handlers.
|
|
@@ -11540,6 +11546,7 @@ class Call {
|
|
|
11540
11546
|
if (callingState === CallingState.JOINING) {
|
|
11541
11547
|
await this.assertCallJoined();
|
|
11542
11548
|
}
|
|
11549
|
+
this.isLeaving = true;
|
|
11543
11550
|
if (this.ringing) {
|
|
11544
11551
|
// I'm the one who started the call, so I should cancel it.
|
|
11545
11552
|
const hasOtherParticipants = this.state.remoteParticipants.length > 0;
|
|
@@ -11829,6 +11836,10 @@ class Call {
|
|
|
11829
11836
|
// unregister the "goAway" handler, as we won't need it anymore for this connection.
|
|
11830
11837
|
// the upcoming re-join will register a new handler anyway
|
|
11831
11838
|
unregisterGoAway();
|
|
11839
|
+
// when the user has initiated "call.leave()" operation, we shouldn't
|
|
11840
|
+
// care for the WS close code and we shouldn't ever attempt to reconnect
|
|
11841
|
+
if (this.isLeaving)
|
|
11842
|
+
return;
|
|
11832
11843
|
// do nothing if the connection was closed on purpose
|
|
11833
11844
|
if (e.code === StreamSfuClient.NORMAL_CLOSURE)
|
|
11834
11845
|
return;
|
|
@@ -14469,7 +14480,7 @@ class StreamClient {
|
|
|
14469
14480
|
});
|
|
14470
14481
|
};
|
|
14471
14482
|
this.getUserAgent = () => {
|
|
14472
|
-
const version = "0.7.
|
|
14483
|
+
const version = "0.7.6" ;
|
|
14473
14484
|
return (this.userAgent ||
|
|
14474
14485
|
`stream-video-javascript-client-${this.node ? 'node' : 'browser'}-${version}`);
|
|
14475
14486
|
};
|