@dtelecom/livekit-client 1.12.18 → 1.12.20
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/dist/livekit-client.esm.mjs +20 -11
- package/dist/livekit-client.esm.mjs.map +1 -1
- package/dist/livekit-client.umd.js +1 -1
- package/dist/livekit-client.umd.js.map +1 -1
- package/dist/src/room/RTCEngine.d.ts.map +1 -1
- package/dist/src/room/Room.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/room/RTCEngine.ts +18 -9
- package/src/room/Room.ts +6 -4
|
@@ -14198,7 +14198,7 @@ function getMatch(exp, ua) {
|
|
|
14198
14198
|
return match && match.length >= id && match[id] || '';
|
|
14199
14199
|
}
|
|
14200
14200
|
|
|
14201
|
-
var version$1 = "1.12.
|
|
14201
|
+
var version$1 = "1.12.20";
|
|
14202
14202
|
|
|
14203
14203
|
const version = version$1;
|
|
14204
14204
|
const protocolVersion = 9;
|
|
@@ -19516,16 +19516,19 @@ class RTCEngine extends EventEmitter {
|
|
|
19516
19516
|
}
|
|
19517
19517
|
this.setupSignalClientCallbacks();
|
|
19518
19518
|
this.clientConfiguration = joinResponse.clientConfiguration;
|
|
19519
|
+
this.joinAttempts = 0;
|
|
19519
19520
|
return joinResponse;
|
|
19520
19521
|
} catch (e) {
|
|
19521
|
-
if (e instanceof ConnectionError) {
|
|
19522
|
+
if (e instanceof ConnectionError && navigator.onLine === true) {
|
|
19522
19523
|
if (e.reason === 1 /* ConnectionErrorReason.ServerUnreachable */) {
|
|
19523
|
-
|
|
19524
|
-
|
|
19524
|
+
if (this.joinAttempts <= this.maxJoinAttempts) {
|
|
19525
|
+
yield sleep(220 * this.joinAttempts);
|
|
19526
|
+
livekitLogger.warn("Couldn't connect to server, attempt ".concat(this.joinAttempts, " of ").concat(this.maxJoinAttempts));
|
|
19525
19527
|
return this.join(url, token, opts, abortSignal);
|
|
19526
19528
|
}
|
|
19527
19529
|
}
|
|
19528
19530
|
}
|
|
19531
|
+
this.joinAttempts = 0;
|
|
19529
19532
|
throw e;
|
|
19530
19533
|
}
|
|
19531
19534
|
});
|
|
@@ -20015,7 +20018,7 @@ class RTCEngine extends EventEmitter {
|
|
|
20015
20018
|
return null;
|
|
20016
20019
|
}
|
|
20017
20020
|
restartConnection(regionUrl) {
|
|
20018
|
-
var _a, _b, _c, _d, _e;
|
|
20021
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
20019
20022
|
return __awaiter(this, void 0, void 0, function* () {
|
|
20020
20023
|
try {
|
|
20021
20024
|
if (!this.url || !this.token) {
|
|
@@ -20055,7 +20058,13 @@ class RTCEngine extends EventEmitter {
|
|
|
20055
20058
|
// reconnect success
|
|
20056
20059
|
this.emit(EngineEvent.Restarted);
|
|
20057
20060
|
} catch (error) {
|
|
20058
|
-
|
|
20061
|
+
// Check if browser is offline first - no point cycling regions if offline
|
|
20062
|
+
if (navigator.onLine === false) {
|
|
20063
|
+
(_c = this.regionUrlProvider) === null || _c === void 0 ? void 0 : _c.resetAttempts();
|
|
20064
|
+
(_d = this.fallbackUrlProvider) === null || _d === void 0 ? void 0 : _d.resetAttempts();
|
|
20065
|
+
throw error;
|
|
20066
|
+
}
|
|
20067
|
+
let nextRegionUrl = yield (_e = this.regionUrlProvider) === null || _e === void 0 ? void 0 : _e.getNextBestRegionUrl();
|
|
20059
20068
|
if (this.fallbackUrlProvider && !nextRegionUrl) {
|
|
20060
20069
|
nextRegionUrl = this.fallbackUrlProvider.getNextUrl();
|
|
20061
20070
|
}
|
|
@@ -20064,8 +20073,8 @@ class RTCEngine extends EventEmitter {
|
|
|
20064
20073
|
return;
|
|
20065
20074
|
} else {
|
|
20066
20075
|
// no more regions to try (or we're not on cloud)
|
|
20067
|
-
(
|
|
20068
|
-
(
|
|
20076
|
+
(_f = this.regionUrlProvider) === null || _f === void 0 ? void 0 : _f.resetAttempts();
|
|
20077
|
+
(_g = this.fallbackUrlProvider) === null || _g === void 0 ? void 0 : _g.resetAttempts();
|
|
20069
20078
|
throw error;
|
|
20070
20079
|
}
|
|
20071
20080
|
}
|
|
@@ -23783,10 +23792,10 @@ class Room extends EventEmitter {
|
|
|
23783
23792
|
});
|
|
23784
23793
|
});
|
|
23785
23794
|
try {
|
|
23786
|
-
yield Promise.all(elements.map(e => {
|
|
23795
|
+
yield Promise.all([this.acquireAudioContext(), ...elements.map(e => {
|
|
23787
23796
|
e.muted = false;
|
|
23788
23797
|
return e.play();
|
|
23789
|
-
}));
|
|
23798
|
+
})]);
|
|
23790
23799
|
this.handleAudioPlaybackStarted();
|
|
23791
23800
|
} catch (err) {
|
|
23792
23801
|
this.handleAudioPlaybackFailed(err);
|
|
@@ -24018,7 +24027,7 @@ class Room extends EventEmitter {
|
|
|
24018
24027
|
// for iOS a newly created AudioContext is always in `suspended` state.
|
|
24019
24028
|
// we try our best to resume the context here, if that doesn't work, we just continue with regular processing
|
|
24020
24029
|
try {
|
|
24021
|
-
yield this.audioContext.resume();
|
|
24030
|
+
yield Promise.race([this.audioContext.resume(), sleep(200)]);
|
|
24022
24031
|
} catch (e) {
|
|
24023
24032
|
livekitLogger.warn(e);
|
|
24024
24033
|
}
|