@stream-io/video-client 0.0.42 → 0.0.44
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 +28 -2
- package/dist/index.browser.es.js.map +1 -1
- package/dist/index.cjs.js +28 -2
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +28 -2
- package/dist/index.es.js.map +1 -1
- package/dist/src/rtc/Publisher.d.ts +4 -0
- package/dist/src/rtc/Subscriber.d.ts +4 -0
- package/dist/version.d.ts +1 -0
- package/package.json +3 -2
- package/src/StreamVideoClient.ts +11 -0
- package/src/coordinator/connection/client.ts +4 -3
- package/src/rtc/Publisher.ts +17 -5
- package/src/rtc/Subscriber.ts +8 -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.44](https://github.com/GetStream/stream-video-js/compare/client0.0.43...client0.0.44) (2023-07-14)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
* SDK version header ([#790](https://github.com/GetStream/stream-video-js/issues/790)) ([6c662db](https://github.com/GetStream/stream-video-js/commit/6c662db59321db4060b5499d8eaad8a18b1eaf6c))
|
|
11
|
+
|
|
12
|
+
### [0.0.43](https://github.com/GetStream/stream-video-js/compare/client0.0.42...client0.0.43) (2023-07-12)
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
### Bug Fixes
|
|
16
|
+
|
|
17
|
+
* Attempt to recover Publisher PeerConnection ([#787](https://github.com/GetStream/stream-video-js/issues/787)) ([0ac2b58](https://github.com/GetStream/stream-video-js/commit/0ac2b5834fba01c01a5d7d0589ce42a5940643af))
|
|
18
|
+
|
|
5
19
|
### [0.0.42](https://github.com/GetStream/stream-video-js/compare/client0.0.41...client0.0.42) (2023-07-12)
|
|
6
20
|
|
|
7
21
|
|
package/dist/index.browser.es.js
CHANGED
|
@@ -6315,6 +6315,13 @@ class Publisher {
|
|
|
6315
6315
|
yield this.negotiate({ iceRestart: true });
|
|
6316
6316
|
}
|
|
6317
6317
|
});
|
|
6318
|
+
/**
|
|
6319
|
+
* Restarts the ICE connection and renegotiates with the SFU.
|
|
6320
|
+
*/
|
|
6321
|
+
this.restartIce = () => {
|
|
6322
|
+
this.logger('debug', 'Restarting ICE connection');
|
|
6323
|
+
this.pc.restartIce();
|
|
6324
|
+
};
|
|
6318
6325
|
this.onNegotiationNeeded = () => __awaiter(this, void 0, void 0, function* () {
|
|
6319
6326
|
yield this.negotiate();
|
|
6320
6327
|
});
|
|
@@ -6455,7 +6462,12 @@ class Publisher {
|
|
|
6455
6462
|
this.logger('error', `ICE Candidate error`, errorMessage);
|
|
6456
6463
|
};
|
|
6457
6464
|
this.onIceConnectionStateChange = () => {
|
|
6458
|
-
|
|
6465
|
+
const state = this.pc.iceConnectionState;
|
|
6466
|
+
this.logger('debug', `ICE Connection state changed`, state);
|
|
6467
|
+
if (state === 'failed' || state === 'disconnected') {
|
|
6468
|
+
this.logger('warn', `ICE Connection state changed to ${state}. Attempting to restart ICE`);
|
|
6469
|
+
this.restartIce();
|
|
6470
|
+
}
|
|
6459
6471
|
};
|
|
6460
6472
|
this.onIceGatheringStateChange = () => {
|
|
6461
6473
|
this.logger('debug', `ICE Gathering State`, this.pc.iceGatheringState);
|
|
@@ -6582,6 +6594,13 @@ class Subscriber {
|
|
|
6582
6594
|
// replace the PeerConnection instance
|
|
6583
6595
|
this.pc = pc;
|
|
6584
6596
|
};
|
|
6597
|
+
/**
|
|
6598
|
+
* Restarts the ICE connection and renegotiates with the SFU.
|
|
6599
|
+
*/
|
|
6600
|
+
this.restartIce = () => {
|
|
6601
|
+
logger$1('debug', 'Restarting ICE connection');
|
|
6602
|
+
this.pc.restartIce();
|
|
6603
|
+
};
|
|
6585
6604
|
this.handleOnTrack = (e) => {
|
|
6586
6605
|
const [primaryStream] = e.streams;
|
|
6587
6606
|
// example: `e3f6aaf8-b03d-4911-be36-83f47d37a76a:TRACK_TYPE_VIDEO`
|
|
@@ -11311,6 +11330,8 @@ class WSConnectionFallback {
|
|
|
11311
11330
|
}
|
|
11312
11331
|
}
|
|
11313
11332
|
|
|
11333
|
+
const version = '0.0.43';
|
|
11334
|
+
|
|
11314
11335
|
class StreamClient {
|
|
11315
11336
|
/**
|
|
11316
11337
|
* Initialize a client.
|
|
@@ -11768,7 +11789,7 @@ class StreamClient {
|
|
|
11768
11789
|
};
|
|
11769
11790
|
this.getUserAgent = () => {
|
|
11770
11791
|
return (this.userAgent ||
|
|
11771
|
-
`stream-video-javascript-client-${this.node ? 'node' : 'browser'}-${
|
|
11792
|
+
`stream-video-javascript-client-${this.node ? 'node' : 'browser'}-${version}`);
|
|
11772
11793
|
};
|
|
11773
11794
|
this.setUserAgent = (userAgent) => {
|
|
11774
11795
|
this.userAgent = userAgent;
|
|
@@ -12103,6 +12124,11 @@ class StreamVideoClient {
|
|
|
12103
12124
|
}
|
|
12104
12125
|
else {
|
|
12105
12126
|
this.streamClient = new StreamClient(apiKeyOrArgs.apiKey, Object.assign(Object.assign({ persistUserOnConnectionFailure: true }, apiKeyOrArgs.options), { logLevel, logger: this.logger }));
|
|
12127
|
+
const sdkInfo = getSdkInfo();
|
|
12128
|
+
if (sdkInfo) {
|
|
12129
|
+
this.streamClient.setUserAgent(this.streamClient.getUserAgent() +
|
|
12130
|
+
`-video-${SdkType[sdkInfo.type].toLowerCase()}-sdk-${sdkInfo.major}.${sdkInfo.minor}.${sdkInfo.patch}`);
|
|
12131
|
+
}
|
|
12106
12132
|
this.user = apiKeyOrArgs.user;
|
|
12107
12133
|
this.token = apiKeyOrArgs.token || apiKeyOrArgs.tokenProvider;
|
|
12108
12134
|
if (this.user) {
|