@decentnetwork/beagle 0.1.34 → 0.1.35
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/desktop/app.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
window.__DK_UI_VERSION="0.1.
|
|
1
|
+
window.__DK_UI_VERSION="0.1.34";
|
|
2
2
|
const ICON_PATHS = {
|
|
3
3
|
// ---- tab bar (the four must feel like one set) ----
|
|
4
4
|
users: '<path d="M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2"/><circle cx="9" cy="7" r="4"/><path d="M22 21v-2a4 4 0 0 0-3-3.87"/><path d="M16 3.13a4 4 0 0 1 0 7.75"/>',
|
|
@@ -169,11 +169,11 @@ var PeerWebRTC = (() => {
|
|
|
169
169
|
];
|
|
170
170
|
var ICE_RESTART_MAX = 3;
|
|
171
171
|
var ICE_DISCONNECT_GRACE_MS = 4e3;
|
|
172
|
-
var ICE_FAILED_GRACE_MS =
|
|
173
|
-
var _opts, _iceServers, _sessions, _setOutgoingVideoTrack, setOutgoingVideoTrack_fn, _renegotiate, renegotiate_fn, _restartIce, restartIce_fn, _handleSignal, handleSignal_fn, _onOffer, onOffer_fn, _answerRenegotiation, answerRenegotiation_fn, _onAnswer, onAnswer_fn, _onCandidate, onCandidate_fn, _onBye, onBye_fn, _onAuxiliary, onAuxiliary_fn, _createSession, createSession_fn, _wirePeerConnection, wirePeerConnection_fn, _ensureRemoteStream, ensureRemoteStream_fn, _attachLocalMedia, attachLocalMedia_fn, _flushLocalCandidates, flushLocalCandidates_fn, _drainRemoteCandidates, drainRemoteCandidates_fn, _send, send_fn, _sendByeSafe, sendByeSafe_fn, _cleanup, cleanup_fn, _setState, setState_fn, _normId, normId_fn, _toInfo, _newCallId, newCallId_fn, _log, log_fn;
|
|
172
|
+
var ICE_FAILED_GRACE_MS = 12e4;
|
|
173
|
+
var _opts, _iceServers, _sessions, _restartOffersEnabled, _setOutgoingVideoTrack, setOutgoingVideoTrack_fn, _renegotiate, renegotiate_fn, _restartIce, restartIce_fn, _handleSignal, handleSignal_fn, _onOffer, onOffer_fn, _answerRenegotiation, answerRenegotiation_fn, _onAnswer, onAnswer_fn, _onCandidate, onCandidate_fn, _onBye, onBye_fn, _onAuxiliary, onAuxiliary_fn, _createSession, createSession_fn, _wirePeerConnection, wirePeerConnection_fn, _ensureRemoteStream, ensureRemoteStream_fn, _attachLocalMedia, attachLocalMedia_fn, _flushLocalCandidates, flushLocalCandidates_fn, _drainRemoteCandidates, drainRemoteCandidates_fn, _send, send_fn, _sendByeSafe, sendByeSafe_fn, _cleanup, cleanup_fn, _setState, setState_fn, _normId, normId_fn, _toInfo, _newCallId, newCallId_fn, _log, log_fn;
|
|
174
174
|
var CallEngine = class extends Emitter {
|
|
175
175
|
constructor(opts) {
|
|
176
|
-
var _a;
|
|
176
|
+
var _a, _b;
|
|
177
177
|
super();
|
|
178
178
|
/** Point the outgoing video sender at `track` (replaceTrack, no renegotiation
|
|
179
179
|
* needed if a sender exists), flip the transceiver to send, and refresh the
|
|
@@ -220,6 +220,8 @@ var PeerWebRTC = (() => {
|
|
|
220
220
|
__privateAdd(this, _opts, void 0);
|
|
221
221
|
__privateAdd(this, _iceServers, void 0);
|
|
222
222
|
__privateAdd(this, _sessions, /* @__PURE__ */ new Map());
|
|
223
|
+
/** See CallEngineOptions.iceRestartOffers — off by default for native-app safety. */
|
|
224
|
+
__privateAdd(this, _restartOffersEnabled, void 0);
|
|
223
225
|
__privateAdd(this, _toInfo, (session) => ({
|
|
224
226
|
callId: session.callId,
|
|
225
227
|
peerId: session.peerId,
|
|
@@ -231,6 +233,7 @@ var PeerWebRTC = (() => {
|
|
|
231
233
|
}));
|
|
232
234
|
__privateSet(this, _opts, opts);
|
|
233
235
|
__privateSet(this, _iceServers, (_a = opts.iceServers) != null ? _a : DEFAULT_ICE_SERVERS);
|
|
236
|
+
__privateSet(this, _restartOffersEnabled, (_b = opts.iceRestartOffers) != null ? _b : false);
|
|
234
237
|
opts.signaling.onSignal((peerId, signal) => {
|
|
235
238
|
try {
|
|
236
239
|
__privateMethod(this, _handleSignal, handleSignal_fn).call(this, peerId, signal);
|
|
@@ -410,6 +413,7 @@ var PeerWebRTC = (() => {
|
|
|
410
413
|
_opts = new WeakMap();
|
|
411
414
|
_iceServers = new WeakMap();
|
|
412
415
|
_sessions = new WeakMap();
|
|
416
|
+
_restartOffersEnabled = new WeakMap();
|
|
413
417
|
_setOutgoingVideoTrack = new WeakSet();
|
|
414
418
|
setOutgoingVideoTrack_fn = async function(session, track, stream) {
|
|
415
419
|
var _a;
|
|
@@ -655,7 +659,7 @@ var PeerWebRTC = (() => {
|
|
|
655
659
|
break;
|
|
656
660
|
case "disconnected":
|
|
657
661
|
__privateMethod(this, _setState, setState_fn).call(this, session, "disconnected");
|
|
658
|
-
if (session.direction === "outgoing" && !session.restartTimer && session.restartAttempts < ICE_RESTART_MAX) {
|
|
662
|
+
if (__privateGet(this, _restartOffersEnabled) && session.direction === "outgoing" && !session.restartTimer && session.restartAttempts < ICE_RESTART_MAX) {
|
|
659
663
|
session.restartTimer = setTimeout(() => {
|
|
660
664
|
session.restartTimer = void 0;
|
|
661
665
|
const st = pc.iceConnectionState;
|
|
@@ -667,7 +671,7 @@ var PeerWebRTC = (() => {
|
|
|
667
671
|
case "failed":
|
|
668
672
|
if (session.restartAttempts < ICE_RESTART_MAX) {
|
|
669
673
|
__privateMethod(this, _setState, setState_fn).call(this, session, "disconnected");
|
|
670
|
-
if (session.direction === "outgoing")
|
|
674
|
+
if (__privateGet(this, _restartOffersEnabled) && session.direction === "outgoing")
|
|
671
675
|
void __privateMethod(this, _restartIce, restartIce_fn).call(this, session);
|
|
672
676
|
if (session.restartTimer)
|
|
673
677
|
clearTimeout(session.restartTimer);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@decentnetwork/beagle",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.35",
|
|
4
4
|
"description": "Beagle — P2P chat, file transfer and calls for regular users, on the Decent Network. No admin privilege required.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"@decentnetwork/chat-components": "^0.1.3",
|
|
29
29
|
"@decentnetwork/lan": "^0.1.256",
|
|
30
30
|
"@decentnetwork/peer": "^0.1.138",
|
|
31
|
-
"@decentnetwork/peer-webrtc": "^0.2.
|
|
31
|
+
"@decentnetwork/peer-webrtc": "^0.2.13",
|
|
32
32
|
"js-yaml": "^4.1.0",
|
|
33
33
|
"yargs": "^17.7.2"
|
|
34
34
|
},
|