@stream-io/video-client 0.0.7 → 0.0.8
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 +7 -0
- package/dist/index.browser.es.js +17 -5
- package/dist/index.browser.es.js.map +1 -1
- package/dist/index.cjs.js +17 -5
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +17 -5
- package/dist/index.es.js.map +1 -1
- package/dist/src/Call.d.ts +6 -0
- package/package.json +1 -1
- package/src/Call.ts +16 -1
- package/src/rtc/signal.ts +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
|
|
4
4
|
|
|
5
|
+
### [0.0.8](https://github.com/GetStream/stream-video-js/compare/client0.0.7...client0.0.8) (2023-06-09)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
* **react-native:** support reconnection flow ([#458](https://github.com/GetStream/stream-video-js/issues/458)) ([89f2dda](https://github.com/GetStream/stream-video-js/commit/89f2ddafd1397d91f8ddea5a3c69dd62ae027313))
|
|
11
|
+
|
|
5
12
|
### [0.0.7](https://github.com/GetStream/stream-video-js/compare/client0.0.6...client0.0.7) (2023-06-08)
|
|
6
13
|
|
|
7
14
|
|
package/dist/index.browser.es.js
CHANGED
|
@@ -5969,13 +5969,13 @@ const createWebSocketSignalChannel = (opts) => {
|
|
|
5969
5969
|
const ws = new WebSocket(endpoint);
|
|
5970
5970
|
ws.binaryType = 'arraybuffer'; // do we need this?
|
|
5971
5971
|
ws.addEventListener('error', (e) => {
|
|
5972
|
-
console.
|
|
5972
|
+
console.log('Signaling WS channel error', e);
|
|
5973
5973
|
});
|
|
5974
5974
|
ws.addEventListener('close', (e) => {
|
|
5975
|
-
console.
|
|
5975
|
+
console.log('Signaling WS channel is closed', e);
|
|
5976
5976
|
});
|
|
5977
5977
|
ws.addEventListener('open', (e) => {
|
|
5978
|
-
console.log('
|
|
5978
|
+
console.log('Signaling WS channel is open', e);
|
|
5979
5979
|
});
|
|
5980
5980
|
if (onMessage) {
|
|
5981
5981
|
ws.addEventListener('message', (e) => {
|
|
@@ -8318,6 +8318,13 @@ const getSdkInfo = () => {
|
|
|
8318
8318
|
* An object representation of a `Call`.
|
|
8319
8319
|
*/
|
|
8320
8320
|
class Call {
|
|
8321
|
+
/**
|
|
8322
|
+
* A promise that exposes the reconnection logic
|
|
8323
|
+
* The use-case is for the react-native platform where online/offline events are not available in the window
|
|
8324
|
+
*/
|
|
8325
|
+
get rejoin() {
|
|
8326
|
+
return this.rejoinPromise;
|
|
8327
|
+
}
|
|
8321
8328
|
/**
|
|
8322
8329
|
* Constructs a new `Call` instance.
|
|
8323
8330
|
*
|
|
@@ -8363,6 +8370,7 @@ class Call {
|
|
|
8363
8370
|
if (callingState === CallingState.LEFT) {
|
|
8364
8371
|
throw new Error('Cannot leave call that has already been left.');
|
|
8365
8372
|
}
|
|
8373
|
+
this.rejoinPromise = undefined;
|
|
8366
8374
|
if (this.ringing) {
|
|
8367
8375
|
// I'm the one who started the call, so I should cancel it.
|
|
8368
8376
|
const hasOtherParticipants = this.state.remoteParticipants.length > 0;
|
|
@@ -8555,7 +8563,7 @@ class Call {
|
|
|
8555
8563
|
yield sleep(retryInterval(this.reconnectAttempts));
|
|
8556
8564
|
yield this.join(data);
|
|
8557
8565
|
console.log(`Rejoin: ${this.reconnectAttempts} successful!`);
|
|
8558
|
-
if (localParticipant) {
|
|
8566
|
+
if (localParticipant && !isReactNative()) {
|
|
8559
8567
|
const { audioStream, videoStream, screenShareStream: screenShare, } = localParticipant;
|
|
8560
8568
|
// restore previous publishing state
|
|
8561
8569
|
if (audioStream)
|
|
@@ -8567,6 +8575,7 @@ class Call {
|
|
|
8567
8575
|
}
|
|
8568
8576
|
console.log(`Rejoin: state restored ${this.reconnectAttempts}`);
|
|
8569
8577
|
});
|
|
8578
|
+
this.rejoinPromise = rejoin;
|
|
8570
8579
|
// reconnect if the connection was closed unexpectedly. example:
|
|
8571
8580
|
// - SFU crash or restart
|
|
8572
8581
|
// - network change
|
|
@@ -8579,6 +8588,9 @@ class Call {
|
|
|
8579
8588
|
// e.g., the user has been blocked by an admin or moderator
|
|
8580
8589
|
if (e.code === KnownCodes.WS_POLICY_VIOLATION)
|
|
8581
8590
|
return;
|
|
8591
|
+
// do nothing for react-native as its handled by SDK
|
|
8592
|
+
if (isReactNative())
|
|
8593
|
+
return;
|
|
8582
8594
|
if (this.reconnectAttempts < this.maxReconnectAttempts) {
|
|
8583
8595
|
rejoin().catch(() => {
|
|
8584
8596
|
console.log(`Rejoin failed for ${this.reconnectAttempts} times. Giving up.`);
|
|
@@ -10993,7 +11005,7 @@ class StreamClient {
|
|
|
10993
11005
|
}
|
|
10994
11006
|
getUserAgent() {
|
|
10995
11007
|
return (this.userAgent ||
|
|
10996
|
-
`stream-video-javascript-client-${this.node ? 'node' : 'browser'}-${"0.0.
|
|
11008
|
+
`stream-video-javascript-client-${this.node ? 'node' : 'browser'}-${"0.0.7"}`);
|
|
10997
11009
|
}
|
|
10998
11010
|
setUserAgent(userAgent) {
|
|
10999
11011
|
this.userAgent = userAgent;
|