@poolse/sdk 3.2.0-dev.1 → 3.2.0-dev.3

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 CHANGED
@@ -4,6 +4,21 @@ All notable changes to `@poolse/sdk` are documented here. Format follows
4
4
  [Keep a Changelog](https://keepachangelog.com/en/1.1.0/); versions follow
5
5
  [semver](https://semver.org).
6
6
 
7
+ ## [3.2.0-dev.3] — 2026-11-16 (prerelease, npm tag `dev`)
8
+
9
+ No changes; released with the other packages.
10
+
11
+ ## [3.2.0-dev.2] — 2026-11-16 (prerelease, npm tag `dev`)
12
+
13
+ ### Added
14
+
15
+ - Screen sharing in calls and rooms: `CallRoom.setScreenShareEnabled(on, { audio })`,
16
+ `isScreenShareEnabled()` and `canShareScreen()`. Each `CallParticipant` gains
17
+ `screenSharing`, `screenTrack` and `screenTrackRef`, separate from the camera.
18
+ Closing the browser's picker is not an error.
19
+ - `LiveCall.screen_share_allowed`: the workspace lets people share a screen
20
+ (dashboard → Calls). Off, the media token cannot publish one.
21
+
7
22
  ## [3.2.0-dev.1] — 2026-11-04 (prerelease, npm tag `dev`)
8
23
 
9
24
  ### Added
package/dist/index.cjs CHANGED
@@ -1423,6 +1423,56 @@ var CallRoom = class {
1423
1423
  this.emitError(new Error(`could not switch camera: ${String(err)}`));
1424
1424
  }
1425
1425
  }
1426
+ /**
1427
+ * Share a screen or window, or stop sharing.
1428
+ *
1429
+ * On the web the browser opens its own picker. Closing it without
1430
+ * choosing is not an error: the call carries on and nothing is
1431
+ * reported. Stopping from the browser's own "Stop sharing" bar ends
1432
+ * the share the same way, and the roster follows.
1433
+ *
1434
+ * A workspace with screen sharing off (or out of video minutes) has a
1435
+ * media token that cannot publish a screen; LiveKit refuses it and the
1436
+ * refusal arrives through `onError`. Hide the control instead using
1437
+ * the call's `screen_share_allowed`.
1438
+ */
1439
+ async setScreenShareEnabled(enabled, options = {}) {
1440
+ const room = this.room;
1441
+ if (!room) return;
1442
+ const local = room.localParticipant;
1443
+ if (!local.setScreenShareEnabled) {
1444
+ this.emitError(new Error("screen sharing is not available on this platform"));
1445
+ return;
1446
+ }
1447
+ try {
1448
+ await local.setScreenShareEnabled(
1449
+ enabled,
1450
+ enabled ? { audio: options.audio ?? true } : void 0
1451
+ );
1452
+ this.emitParticipants();
1453
+ } catch (err) {
1454
+ const name = err?.name;
1455
+ if (name === "NotAllowedError" || name === "AbortError") {
1456
+ this.emitParticipants();
1457
+ return;
1458
+ }
1459
+ this.emitError(new Error(`could not share the screen: ${String(err)}`));
1460
+ }
1461
+ }
1462
+ isScreenShareEnabled() {
1463
+ return this.room?.localParticipant.isScreenShareEnabled ?? false;
1464
+ }
1465
+ /**
1466
+ * Whether this platform can share a screen at all: a browser with
1467
+ * `getDisplayMedia` (not phone browsers), or a native build with
1468
+ * screen capture. Only meaningful once joined on native.
1469
+ */
1470
+ canShareScreen() {
1471
+ const local = this.room?.localParticipant;
1472
+ if (local && !local.setScreenShareEnabled) return false;
1473
+ if (typeof document === "undefined") return !!local?.setScreenShareEnabled;
1474
+ return typeof globalThis.navigator?.mediaDevices?.getDisplayMedia === "function";
1475
+ }
1426
1476
  /** Which camera the local video track is capturing from. */
1427
1477
  getFacingMode() {
1428
1478
  return this.facing;
@@ -1589,6 +1639,9 @@ var CallRoom = class {
1589
1639
  const publication = participant.getTrackPublication(cameraSource);
1590
1640
  const live = publication && !publication.isMuted && publication.track ? publication : null;
1591
1641
  const videoTrack = live?.track ?? null;
1642
+ const screenSource = this.livekit.Track.Source["ScreenShare"] ?? "screen_share";
1643
+ const screenPublication = participant.getTrackPublication(screenSource);
1644
+ const screen = screenPublication && !screenPublication.isMuted && screenPublication.track ? screenPublication : null;
1592
1645
  return {
1593
1646
  userId: participant.identity,
1594
1647
  name: participant.name,
@@ -1597,7 +1650,10 @@ var CallRoom = class {
1597
1650
  cameraEnabled: participant.isCameraEnabled ?? false,
1598
1651
  speaking: participant.isSpeaking ?? false,
1599
1652
  videoTrack,
1600
- videoTrackRef: live ? { participant, publication: live, source: cameraSource } : null
1653
+ videoTrackRef: live ? { participant, publication: live, source: cameraSource } : null,
1654
+ screenSharing: !!screen,
1655
+ screenTrack: screen?.track ?? null,
1656
+ screenTrackRef: screen ? { participant, publication: screen, source: screenSource } : null
1601
1657
  };
1602
1658
  }
1603
1659
  async teardown() {
@@ -1986,7 +2042,7 @@ var Poolse = class {
1986
2042
  };
1987
2043
 
1988
2044
  // src/version.ts
1989
- var version = "3.2.0-dev.1";
2045
+ var version = "3.2.0-dev.3";
1990
2046
 
1991
2047
  // src/call-log.ts
1992
2048
  function parseCallLogBody(body) {