@decentnetwork/lan 0.1.178 → 0.1.179
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.
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -291,6 +291,7 @@ var PeerWebRTC = (() => {
|
|
|
291
291
|
* so the peer receives it. Works even with no camera. Ending the OS "stop
|
|
292
292
|
* sharing" prompt reverts automatically. */
|
|
293
293
|
async shareScreen(callId) {
|
|
294
|
+
var _a, _b, _c;
|
|
294
295
|
const session = __privateGet(this, _sessions).get(__privateMethod(this, _CallEngine_instances, normId_fn).call(this, callId));
|
|
295
296
|
if (!session)
|
|
296
297
|
throw new Error(`shareScreen: no call ${callId}`);
|
|
@@ -300,8 +301,11 @@ var PeerWebRTC = (() => {
|
|
|
300
301
|
const track = screen.getVideoTracks()[0];
|
|
301
302
|
if (!track)
|
|
302
303
|
return;
|
|
303
|
-
if (!session.screenStream)
|
|
304
|
-
session.
|
|
304
|
+
if (!session.screenStream) {
|
|
305
|
+
session.hadCamera = !!((_a = session.localStream) == null ? void 0 : _a.getVideoTracks().length);
|
|
306
|
+
for (const t of (_c = (_b = session.localStream) == null ? void 0 : _b.getVideoTracks()) != null ? _c : [])
|
|
307
|
+
t.stop();
|
|
308
|
+
}
|
|
305
309
|
session.screenStream = screen;
|
|
306
310
|
await __privateMethod(this, _CallEngine_instances, setOutgoingVideoTrack_fn).call(this, session, track, screen);
|
|
307
311
|
track.addEventListener("ended", () => {
|
|
@@ -310,7 +314,7 @@ var PeerWebRTC = (() => {
|
|
|
310
314
|
await __privateMethod(this, _CallEngine_instances, renegotiate_fn).call(this, session);
|
|
311
315
|
__privateMethod(this, _CallEngine_instances, log_fn).call(this, `shareScreen started for ${callId}`);
|
|
312
316
|
}
|
|
313
|
-
/** Stop screen sharing;
|
|
317
|
+
/** Stop screen sharing; re-acquire the camera if there was one. */
|
|
314
318
|
async stopScreenShare(callId) {
|
|
315
319
|
var _a;
|
|
316
320
|
const session = __privateGet(this, _sessions).get(__privateMethod(this, _CallEngine_instances, normId_fn).call(this, callId));
|
|
@@ -319,9 +323,12 @@ var PeerWebRTC = (() => {
|
|
|
319
323
|
for (const t of session.screenStream.getTracks())
|
|
320
324
|
t.stop();
|
|
321
325
|
session.screenStream = void 0;
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
326
|
+
let cam;
|
|
327
|
+
if (session.hadCamera && __privateGet(this, _opts).getLocalMedia) {
|
|
328
|
+
cam = await __privateGet(this, _opts).getLocalMedia({ audio: false, video: true }).catch(() => void 0);
|
|
329
|
+
}
|
|
330
|
+
session.hadCamera = false;
|
|
331
|
+
await __privateMethod(this, _CallEngine_instances, setOutgoingVideoTrack_fn).call(this, session, (_a = cam == null ? void 0 : cam.getVideoTracks()[0]) != null ? _a : null, cam);
|
|
325
332
|
await __privateMethod(this, _CallEngine_instances, renegotiate_fn).call(this, session);
|
|
326
333
|
__privateMethod(this, _CallEngine_instances, log_fn).call(this, `shareScreen stopped for ${callId}`);
|
|
327
334
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@decentnetwork/lan",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.179",
|
|
4
4
|
"description": "Private virtual LAN for self-hosted services and AI agents, built on Elastos Carrier. NAT-traversal, name service, ACL, all over a peer-to-peer mesh — no public IP required.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -80,7 +80,7 @@
|
|
|
80
80
|
"dependencies": {
|
|
81
81
|
"@decentnetwork/dora": "^0.1.13",
|
|
82
82
|
"@decentnetwork/peer": "^0.1.91",
|
|
83
|
-
"@decentnetwork/peer-webrtc": "^0.2.
|
|
83
|
+
"@decentnetwork/peer-webrtc": "^0.2.10",
|
|
84
84
|
"ink": "^5.2.1",
|
|
85
85
|
"js-yaml": "^4.1.0",
|
|
86
86
|
"node-forge": "^1.4.0",
|