@tribe-nest/media-client 0.1.0 → 0.1.1

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.
@@ -56,12 +56,19 @@ export type MediaTrack = {
56
56
  /** Paused at the SOURCE, as the publisher left it. */
57
57
  paused: boolean;
58
58
  };
59
+ /** What a local track is, in the vocabulary the node checks against `publishKinds`. */
60
+ export type LocalPublicationSource = "camera" | "microphone" | "screen";
59
61
  export type LocalPublication = {
60
62
  producerId: string;
61
63
  kind: "audio" | "video";
62
- source: string;
64
+ source: LocalPublicationSource;
63
65
  track: MediaStreamTrack;
64
66
  handle: MediaProducerHandle;
67
+ /**
68
+ * Paused at the source by `setPaused`. The capture is still open and the
69
+ * producer still exists; nothing is being sent. This is what a mute is.
70
+ */
71
+ paused: boolean;
65
72
  };
66
73
  export type MediaRoomOptions = {
67
74
  /**
@@ -97,13 +104,15 @@ export declare class MediaRoom {
97
104
  private readonly options;
98
105
  private readonly signal;
99
106
  private readonly device;
100
- private sendTransport;
101
- private recvTransport;
107
+ /** One slot per direction: the finished transport, or the creation in flight. */
108
+ private readonly transports;
102
109
  private iceServers;
103
110
  private grantsValue;
104
111
  private readonly consumers;
105
112
  private readonly tracksByProducer;
106
113
  private readonly publications;
114
+ /** Per publication: stop listening for the track ending on its own. */
115
+ private readonly trackEndWatchers;
107
116
  private readonly listeners;
108
117
  /** One in-flight subscribe per producer, so a burst of activeSpeakers frames
109
118
  * does not race itself into two consumers for one producer. */
@@ -118,6 +127,11 @@ export declare class MediaRoom {
118
127
  /** `close()` has been called. Nothing may open a socket after that. */
119
128
  private disposed;
120
129
  constructor(options: MediaRoomOptions);
130
+ /**
131
+ * The one place that decides what happens after a connection ends, whether
132
+ * it ended after an hour or before a socket was ever opened.
133
+ */
134
+ private onDisconnect;
121
135
  get state(): RoomState;
122
136
  get connectionState(): ConnectionState;
123
137
  get error(): DisconnectCause | undefined;
@@ -145,8 +159,26 @@ export declare class MediaRoom {
145
159
  */
146
160
  private trackSnapshot;
147
161
  private publicationSnapshot;
162
+ private lostSources;
148
163
  get tracks(): MediaTrack[];
149
164
  get localPublications(): LocalPublication[];
165
+ /**
166
+ * What the person was sending when the connection dropped, and is not now.
167
+ *
168
+ * A drop tears down every local publication and STOPS its capture (see
169
+ * `teardownMedia`): the camera light goes out, which is the right thing for a
170
+ * capture whose session has ended and the wrong thing to do silently to a
171
+ * capture whose session is about to resume. The room does not republish on
172
+ * its own. Capture is a browser permission with a UI consequence, and turning
173
+ * a person's camera back on without a press, possibly minutes later, is not a
174
+ * decision this layer gets to make. So instead it says what was lost, and the
175
+ * screen tells the person, who presses the button.
176
+ *
177
+ * Cleared per source when that source is published again, and wholesale by
178
+ * `close()`. A stable reference while unchanged, like every other snapshot
179
+ * here, because `useSyncExternalStore` reads it.
180
+ */
181
+ get lostPublicationSources(): readonly LocalPublicationSource[];
150
182
  /** Subscribe to changes. Returns an unsubscribe. */
151
183
  onChange(listener: Listener): () => void;
152
184
  connect(): Promise<void>;
@@ -174,8 +206,19 @@ export declare class MediaRoom {
174
206
  * `publishKinds`: a token granting audio only must not be able to publish a
175
207
  * screen share by relabelling it, and the node is where that is decided.
176
208
  */
177
- publish(track: MediaStreamTrack, source: "camera" | "microphone" | "screen"): Promise<LocalPublication>;
209
+ publish(track: MediaStreamTrack, source: LocalPublicationSource): Promise<LocalPublication>;
178
210
  unpublish(producerId: string): Promise<void>;
211
+ /**
212
+ * Mute or unmute at the source, keeping the capture and the producer.
213
+ *
214
+ * This is what a Mute button does, and it is deliberately NOT unpublish plus
215
+ * publish. Every publish begins with `getUserMedia`, and Safari asks
216
+ * permission on every call to it, so a toggle built on republishing put a
217
+ * permission prompt in front of the person on every unmute. The producer is
218
+ * paused (mediasoup disables the track, so nothing is sent), the node is told
219
+ * so the other side sees `producerPaused`, and resuming is instant and asks
220
+ * nobody anything.
221
+ */
179
222
  setPaused(producerId: string, paused: boolean): Promise<void>;
180
223
  /**
181
224
  * Bring subscriptions in line with what the node says we should be receiving.
@@ -190,9 +233,29 @@ export declare class MediaRoom {
190
233
  syncSubscriptions(): Promise<void>;
191
234
  subscribe(producerId: string): Promise<void>;
192
235
  private doSubscribe;
193
- /** RULE 2: lazily, and once. */
236
+ /**
237
+ * RULE 2: lazily, and once.
238
+ *
239
+ * "Once" has to hold under CONCURRENCY, not just in sequence. `createTransport`
240
+ * is a round trip to the node, and `syncSubscriptions` fans out with
241
+ * `Promise.all`, so one `activeSpeakers` frame naming four producers puts
242
+ * four callers through here in the same tick. A check of the finished
243
+ * transport followed by an await let all four pass the check and send four
244
+ * `createTransport(recv)`: the node caps transports per session, so the
245
+ * fourth was the last one this session would ever get and the person's own
246
+ * Unmute was refused with `capacity` for the rest of the call. So the thing
247
+ * memoised is the in-flight PROMISE, and it is memoised before anything is
248
+ * awaited.
249
+ *
250
+ * A creation that fails is forgotten, so the next caller tries again rather
251
+ * than inheriting a rejection for ever; and `teardownMedia` forgets both,
252
+ * because a transport created against a connection that has since died
253
+ * belongs to that connection, not to the one that replaces it.
254
+ */
194
255
  private ensureSendTransport;
195
256
  private ensureRecvTransport;
257
+ private ensureTransport;
258
+ private createTransport;
196
259
  private onFrame;
197
260
  /**
198
261
  * Everything the connection was carrying, released.
@@ -1 +1 @@
1
- {"version":3,"file":"room.d.ts","sourceRoot":"","sources":["../../src/room/room.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAc,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAE1E,OAAO,EAKL,KAAK,eAAe,EACpB,KAAK,oBAAoB,EACzB,KAAK,qBAAqB,EAC1B,KAAK,gBAAgB,EACrB,KAAK,SAAS,EACd,KAAK,cAAc,EACpB,MAAM,SAAS,CAAC;AACjB,OAAO,KAAK,EAIV,kBAAkB,EAClB,mBAAmB,EAIpB,MAAM,UAAU,CAAC;AAElB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4CG;AAEH,MAAM,MAAM,oBAAoB,GAAG,oBAA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E1C;IAED;;;;;;;;;;;;;;;OAeG;IACH,IAAI,sBAAsB,IAAI,SAAS,sBAAsB,EAAE,CAE9D;IAED,oDAAoD;IACpD,QAAQ,CAAC,QAAQ,EAAE,QAAQ,GAAG,MAAM,IAAI;IAKlC,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;IAwDxB,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAe5B;;;;;;;;;;;;;OAaG;IACH,OAAO,CAAC,iBAAiB;IA2BzB,OAAO,CAAC,eAAe;IAUvB;;;;;;OAMG;IACG,OAAO,CAAC,KAAK,EAAE,gBAAgB,EAAE,MAAM,EAAE,sBAAsB,GAAG,OAAO,CAAC,gBAAgB,CAAC;IAoC3F,SAAS,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAelD;;;;;;;;;;OAUG;IACG,SAAS,CAAC,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC;IAmBnE;;;;;;;;;OASG;IACG,iBAAiB,IAAI,OAAO,CAAC,IAAI,CAAC;IAkBlC,SAAS,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;YAYpC,WAAW;IAwCzB;;;;;;;;;;;;;;;;;;OAkBG;IACH,OAAO,CAAC,mBAAmB;IAI3B,OAAO,CAAC,mBAAmB;IAI3B,OAAO,CAAC,eAAe;YA0BT,eAAe;IAgC7B,OAAO,CAAC,OAAO;IAwBf;;;;;;;;;;;;;;;;OAgBG;IACH,OAAO,CAAC,aAAa;IAuBrB,OAAO,CAAC,IAAI;CAeb;AAsBD,wBAAsB,aAAa,CAAC,OAAO,EAAE,gBAAgB,GAAG,OAAO,CAAC,SAAS,CAAC,CAIjF"}
@@ -7,13 +7,18 @@ class MediaRoom {
7
7
  options;
8
8
  signal;
9
9
  device;
10
- sendTransport;
11
- recvTransport;
10
+ /** One slot per direction: the finished transport, or the creation in flight. */
11
+ transports = {
12
+ send: { ready: undefined, creating: undefined },
13
+ recv: { ready: undefined, creating: undefined },
14
+ };
12
15
  iceServers = [];
13
16
  grantsValue;
14
17
  consumers = new Map();
15
18
  tracksByProducer = new Map();
16
19
  publications = new Map();
20
+ /** Per publication: stop listening for the track ending on its own. */
21
+ trackEndWatchers = new Map();
17
22
  listeners = new Set();
18
23
  /** One in-flight subscribe per producer, so a burst of activeSpeakers frames
19
24
  * does not race itself into two consumers for one producer. */
@@ -36,21 +41,40 @@ class MediaRoom {
36
41
  ...(options.onLog ? { onLog: options.onLog } : {}),
37
42
  });
38
43
  this.signal.onAny((frame) => this.onFrame(frame));
39
- this.signal.onClose((cause) => {
40
- this.lastError = cause;
41
- // Before the decision, and unconditionally. The transports are dead
42
- // whatever happens next, and so is every capture that was feeding them.
43
- this.teardownMedia();
44
- if (cause.type === "closed_by_client") {
45
- this.connection = "closed";
46
- this.recovering = false;
47
- this.emit();
48
- return;
49
- }
50
- this.connection = "reconnecting";
51
- this.recovering = this.scheduleReconnect(cause);
44
+ this.signal.onClose((cause) => this.onDisconnect(cause));
45
+ }
46
+ /**
47
+ * The one place that decides what happens after a connection ends, whether
48
+ * it ended after an hour or before a socket was ever opened.
49
+ */
50
+ onDisconnect(cause) {
51
+ this.lastError = cause;
52
+ // What the person was sending, before it is torn down. Recorded so the
53
+ // screen can say so once the room is back (see `lostPublicationSources`).
54
+ const wasPublishing = [...new Set([...this.publications.values()].map((p) => p.source))];
55
+ // Before the decision, and unconditionally. The transports are dead
56
+ // whatever happens next, and so is every capture that was feeding them.
57
+ this.teardownMedia();
58
+ // The active set was an instruction about consumers on THIS connection,
59
+ // and those are gone. Left standing, it would be mistaken by the next
60
+ // `joined` for a set the new node had sent ahead of the snapshot.
61
+ if (this.stateValue.activeSpeakers.length > 0) {
62
+ this.stateValue = { ...this.stateValue, activeSpeakers: [] };
63
+ }
64
+ // `disposed` as well as the cause: `close()` is a client close whatever the
65
+ // socket's own account of it, and a room that has been closed must never
66
+ // report itself as coming back.
67
+ if (cause.type === "closed_by_client" || this.disposed) {
68
+ this.connection = "closed";
69
+ this.recovering = false;
52
70
  this.emit();
53
- });
71
+ return;
72
+ }
73
+ if (wasPublishing.length > 0)
74
+ this.lostSources = wasPublishing;
75
+ this.connection = "reconnecting";
76
+ this.recovering = this.scheduleReconnect(cause);
77
+ this.emit();
54
78
  }
55
79
  get state() {
56
80
  return this.stateValue;
@@ -89,25 +113,73 @@ class MediaRoom {
89
113
  */
90
114
  trackSnapshot = [];
91
115
  publicationSnapshot = [];
116
+ lostSources = NO_SOURCES;
92
117
  get tracks() {
93
118
  return this.trackSnapshot;
94
119
  }
95
120
  get localPublications() {
96
121
  return this.publicationSnapshot;
97
122
  }
123
+ /**
124
+ * What the person was sending when the connection dropped, and is not now.
125
+ *
126
+ * A drop tears down every local publication and STOPS its capture (see
127
+ * `teardownMedia`): the camera light goes out, which is the right thing for a
128
+ * capture whose session has ended and the wrong thing to do silently to a
129
+ * capture whose session is about to resume. The room does not republish on
130
+ * its own. Capture is a browser permission with a UI consequence, and turning
131
+ * a person's camera back on without a press, possibly minutes later, is not a
132
+ * decision this layer gets to make. So instead it says what was lost, and the
133
+ * screen tells the person, who presses the button.
134
+ *
135
+ * Cleared per source when that source is published again, and wholesale by
136
+ * `close()`. A stable reference while unchanged, like every other snapshot
137
+ * here, because `useSyncExternalStore` reads it.
138
+ */
139
+ get lostPublicationSources() {
140
+ return this.lostSources;
141
+ }
98
142
  /** Subscribe to changes. Returns an unsubscribe. */
99
143
  onChange(listener) {
100
144
  this.listeners.add(listener);
101
145
  return () => this.listeners.delete(listener);
102
146
  }
103
147
  async connect() {
148
+ // Refused BEFORE touching any state. The signal refuses this too, but by
149
+ // then `connection` would already read "connecting" over a socket that is
150
+ // joined, and nothing would ever put it back.
151
+ const phase = this.signal.phase;
152
+ if (phase === "connecting" || phase === "joining" || phase === "joined") {
153
+ throw new Error("connect() called on a room that is already connecting or connected");
154
+ }
104
155
  this.cancelReconnect();
105
156
  // A retry is not a first connection, and saying "Connecting to the call"
106
157
  // over a call somebody is already in reads as though they had been thrown
107
158
  // out of it.
108
159
  this.connection = this.reconnectAttempt > 0 ? "reconnecting" : "connecting";
109
160
  this.emit();
110
- const joined = await this.signal.connect();
161
+ // A failed attempt normally reports itself through `signal.onClose`, which
162
+ // routes to `onDisconnect`. This watches for that report so a rejection
163
+ // that arrives WITHOUT one (nothing in the signal does that today; this is
164
+ // the belt to its braces) is still counted as a failed attempt rather than
165
+ // leaving `connection` on "connecting" with no retry booked and no error
166
+ // to show.
167
+ let disconnectReported = false;
168
+ const stopWatching = this.signal.onClose(() => {
169
+ disconnectReported = true;
170
+ });
171
+ let joined;
172
+ try {
173
+ joined = await this.signal.connect();
174
+ }
175
+ catch (error) {
176
+ if (!disconnectReported)
177
+ this.onDisconnect((0, core_1.causeFromError)(error));
178
+ throw error;
179
+ }
180
+ finally {
181
+ stopWatching();
182
+ }
111
183
  // RULE 1: the device loads first. Everything below needs its capabilities.
112
184
  if (!this.device.loaded) {
113
185
  await this.device.load(joined.routerRtpCapabilities);
@@ -130,6 +202,7 @@ class MediaRoom {
130
202
  this.cancelReconnect();
131
203
  this.recovering = false;
132
204
  this.connection = "closed";
205
+ this.lostSources = NO_SOURCES;
133
206
  await this.signal.leave().catch(() => undefined);
134
207
  this.teardownMedia();
135
208
  this.emit();
@@ -168,8 +241,10 @@ class MediaRoom {
168
241
  if (this.disposed)
169
242
  return;
170
243
  this.reconnectAttempt += 1;
171
- // A failed attempt comes back through `signal.onClose`, which is the only
172
- // place that decides. Swallowed here so a retry does not surface as an
244
+ // A failed attempt comes back through `onDisconnect`, which is the only
245
+ // place that decides, and that holds for an attempt that fails BEFORE it
246
+ // has a socket (the ticket endpoint refusing) as much as for one that
247
+ // drops after an hour. Swallowed here so a retry does not surface as an
173
248
  // unhandled rejection in the host application's console.
174
249
  void this.connect().catch(() => undefined);
175
250
  }, decision.delayMs);
@@ -204,8 +279,21 @@ class MediaRoom {
204
279
  source,
205
280
  track,
206
281
  handle,
282
+ paused: false,
207
283
  };
208
284
  this.publications.set(handle.id, publication);
285
+ // A track can end WITHOUT us: the browser's own "Stop sharing" bar, a
286
+ // camera unplugged, a device revoked from the OS. Nothing about that reaches
287
+ // `unpublish`, so the node kept a producer nobody was feeding and the
288
+ // control above still read "Stop sharing" about a share that had ended.
289
+ this.trackEndWatchers.set(handle.id, whenTrackEnds(track, () => {
290
+ void this.unpublish(handle.id);
291
+ }));
292
+ if (this.lostSources.includes(source)) {
293
+ this.lostSources = this.lostSources.filter((s) => s !== source);
294
+ if (this.lostSources.length === 0)
295
+ this.lostSources = NO_SOURCES;
296
+ }
209
297
  this.emit();
210
298
  return publication;
211
299
  }
@@ -213,6 +301,8 @@ class MediaRoom {
213
301
  const publication = this.publications.get(producerId);
214
302
  if (!publication)
215
303
  return;
304
+ this.trackEndWatchers.get(producerId)?.();
305
+ this.trackEndWatchers.delete(producerId);
216
306
  publication.handle.close();
217
307
  publication.track.stop();
218
308
  this.publications.delete(producerId);
@@ -221,18 +311,32 @@ class MediaRoom {
221
311
  await this.signal.request({ method: "closeProducer", producerId }).catch(() => undefined);
222
312
  this.emit();
223
313
  }
314
+ /**
315
+ * Mute or unmute at the source, keeping the capture and the producer.
316
+ *
317
+ * This is what a Mute button does, and it is deliberately NOT unpublish plus
318
+ * publish. Every publish begins with `getUserMedia`, and Safari asks
319
+ * permission on every call to it, so a toggle built on republishing put a
320
+ * permission prompt in front of the person on every unmute. The producer is
321
+ * paused (mediasoup disables the track, so nothing is sent), the node is told
322
+ * so the other side sees `producerPaused`, and resuming is instant and asks
323
+ * nobody anything.
324
+ */
224
325
  async setPaused(producerId, paused) {
225
326
  const publication = this.publications.get(producerId);
226
- if (!publication)
327
+ if (!publication || publication.paused === paused)
227
328
  return;
228
329
  if (paused)
229
330
  publication.handle.pause();
230
331
  else
231
332
  publication.handle.resume();
333
+ // A new object, so the snapshot moves and a screen reading `paused` follows.
334
+ // Emitted before the round trip: the local effect is already true.
335
+ this.publications.set(producerId, { ...publication, paused });
336
+ this.emit();
232
337
  await this.signal
233
338
  .request({ method: paused ? "pauseProducer" : "resumeProducer", producerId })
234
339
  .catch(() => undefined);
235
- this.emit();
236
340
  }
237
341
  // -------------------------------------------------------------------------
238
342
  // subscribing
@@ -310,21 +414,68 @@ class MediaRoom {
310
414
  // -------------------------------------------------------------------------
311
415
  // transports
312
416
  // -------------------------------------------------------------------------
313
- /** RULE 2: lazily, and once. */
314
- async ensureSendTransport() {
315
- if (this.sendTransport)
316
- return this.sendTransport;
317
- const description = (await this.signal.request({
318
- method: "createTransport",
319
- direction: "send",
320
- }));
321
- this.sendTransport = this.device.createSendTransport({
417
+ /**
418
+ * RULE 2: lazily, and once.
419
+ *
420
+ * "Once" has to hold under CONCURRENCY, not just in sequence. `createTransport`
421
+ * is a round trip to the node, and `syncSubscriptions` fans out with
422
+ * `Promise.all`, so one `activeSpeakers` frame naming four producers puts
423
+ * four callers through here in the same tick. A check of the finished
424
+ * transport followed by an await let all four pass the check and send four
425
+ * `createTransport(recv)`: the node caps transports per session, so the
426
+ * fourth was the last one this session would ever get and the person's own
427
+ * Unmute was refused with `capacity` for the rest of the call. So the thing
428
+ * memoised is the in-flight PROMISE, and it is memoised before anything is
429
+ * awaited.
430
+ *
431
+ * A creation that fails is forgotten, so the next caller tries again rather
432
+ * than inheriting a rejection for ever; and `teardownMedia` forgets both,
433
+ * because a transport created against a connection that has since died
434
+ * belongs to that connection, not to the one that replaces it.
435
+ */
436
+ ensureSendTransport() {
437
+ return this.ensureTransport("send");
438
+ }
439
+ ensureRecvTransport() {
440
+ return this.ensureTransport("recv");
441
+ }
442
+ ensureTransport(direction) {
443
+ const slot = this.transports[direction];
444
+ if (slot.ready)
445
+ return Promise.resolve(slot.ready);
446
+ if (slot.creating)
447
+ return slot.creating;
448
+ const creating = this.createTransport(direction);
449
+ slot.creating = creating;
450
+ creating.then((transport) => {
451
+ if (slot.creating !== creating) {
452
+ // Torn down while the round trip was in flight. The connection this
453
+ // transport was created for is gone, so it is closed rather than kept
454
+ // for the next one.
455
+ transport.close();
456
+ return;
457
+ }
458
+ slot.ready = transport;
459
+ slot.creating = undefined;
460
+ }, () => {
461
+ if (slot.creating === creating)
462
+ slot.creating = undefined;
463
+ });
464
+ return creating;
465
+ }
466
+ async createTransport(direction) {
467
+ const description = (await this.signal.request({ method: "createTransport", direction }));
468
+ const onConnect = async (dtlsParameters) => {
469
+ await this.signal.request({ method: "connectTransport", transportId: description.transportId, dtlsParameters });
470
+ };
471
+ if (direction === "recv") {
472
+ return this.device.createRecvTransport({ description, iceServers: this.iceServers, handlers: { onConnect } });
473
+ }
474
+ return this.device.createSendTransport({
322
475
  description,
323
476
  iceServers: this.iceServers,
324
477
  handlers: {
325
- onConnect: async (dtlsParameters) => {
326
- await this.signal.request({ method: "connectTransport", transportId: description.transportId, dtlsParameters });
327
- },
478
+ onConnect,
328
479
  onProduce: async ({ kind, rtpParameters, appData }) => {
329
480
  const produced = (await this.signal.request({
330
481
  method: "produce",
@@ -337,25 +488,6 @@ class MediaRoom {
337
488
  },
338
489
  },
339
490
  });
340
- return this.sendTransport;
341
- }
342
- async ensureRecvTransport() {
343
- if (this.recvTransport)
344
- return this.recvTransport;
345
- const description = (await this.signal.request({
346
- method: "createTransport",
347
- direction: "recv",
348
- }));
349
- this.recvTransport = this.device.createRecvTransport({
350
- description,
351
- iceServers: this.iceServers,
352
- handlers: {
353
- onConnect: async (dtlsParameters) => {
354
- await this.signal.request({ method: "connectTransport", transportId: description.transportId, dtlsParameters });
355
- },
356
- },
357
- });
358
- return this.recvTransport;
359
491
  }
360
492
  // -------------------------------------------------------------------------
361
493
  // events
@@ -403,15 +535,22 @@ class MediaRoom {
403
535
  consumer.close();
404
536
  this.consumers.clear();
405
537
  this.tracksByProducer.clear();
538
+ for (const detach of this.trackEndWatchers.values())
539
+ detach();
540
+ this.trackEndWatchers.clear();
406
541
  for (const publication of this.publications.values()) {
407
542
  publication.handle.close();
408
543
  publication.track.stop();
409
544
  }
410
545
  this.publications.clear();
411
- this.sendTransport?.close();
412
- this.recvTransport?.close();
413
- this.sendTransport = undefined;
414
- this.recvTransport = undefined;
546
+ for (const slot of Object.values(this.transports)) {
547
+ slot.ready?.close();
548
+ slot.ready = undefined;
549
+ // A creation still in flight belongs to the connection that just died.
550
+ // Forgetting it here is what makes `ensureTransport` close the result
551
+ // when it lands, and what lets the next connection create its own.
552
+ slot.creating = undefined;
553
+ }
415
554
  }
416
555
  emit() {
417
556
  // Rebuilt HERE, once per change, rather than per read. Every mutation
@@ -430,6 +569,24 @@ class MediaRoom {
430
569
  }
431
570
  }
432
571
  exports.MediaRoom = MediaRoom;
572
+ const NO_SOURCES = [];
573
+ /**
574
+ * Call `onEnded` when a track ends on its own, and return the detach.
575
+ *
576
+ * `ended` fires when the SOURCE goes away (the browser's share bar, a device
577
+ * unplugged), and not for our own `track.stop()`, which is what lets
578
+ * `unpublish` stop the track without re-entering itself. Guarded because a
579
+ * track outside a browser (this package's specs hand the room bare objects) is
580
+ * not an `EventTarget`; in every browser it is.
581
+ */
582
+ function whenTrackEnds(track, onEnded) {
583
+ const target = track;
584
+ if (typeof target.addEventListener !== "function" || typeof target.removeEventListener !== "function") {
585
+ return () => undefined;
586
+ }
587
+ target.addEventListener("ended", onEnded);
588
+ return () => target.removeEventListener?.("ended", onEnded);
589
+ }
433
590
  async function connectToRoom(options) {
434
591
  const room = new MediaRoom(options);
435
592
  await room.connect();
@@ -1 +1 @@
1
- {"version":3,"file":"room.js","sourceRoot":"","sources":["../../src/room/room.ts"],"names":[],"mappings":";;;AAmlBA,sCAIC;AArlBD,kCAWiB;AA+GjB,MAAa,SAAS;IA2BS;IA1BZ,MAAM,CAAc;IACpB,MAAM,CAAc;IAC7B,aAAa,CAA6B;IAC1C,aAAa,CAA6B;IAC1C,UAAU,GAAgB,EAAE,CAAC;IAC7B,WAAW,CAA0B;IAE5B,SAAS,GAAG,IAAI,GAAG,EAA+B,CAAC;IACnD,gBAAgB,GAAG,IAAI,GAAG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3D,MAAM,IAAI,GAAG,IAAI,SAAS,CAAC,OAAO,CAAC,CAAC;IACpC,MAAM,IAAI,CAAC,OAAO,EAAE,CAAC;IACrB,OAAO,IAAI,CAAC;AACd,CAAC"}
package/package.json CHANGED
@@ -1,11 +1,13 @@
1
1
  {
2
2
  "name": "@tribe-nest/media-client",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
7
7
  "description": "Client SDK for the media network. `./core` is the HEADLESS half: a WebSocket client speaking media-protocol frames, backoff-with-jitter reconnection and a pure room-state reducer. Zero DOM, zero mediasoup-client, zero React, because the load harness, the egress client and the SIP gateway all need a protocol client and none of them is a browser.",
8
8
  "sideEffects": false,
9
+ "main": "./build/index.js",
10
+ "types": "./build/index.d.ts",
9
11
  "exports": {
10
12
  ".": {
11
13
  "types": "./build/index.d.ts",