@ai-matrx/meet 0.7.9 → 0.7.10

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
@@ -1,5 +1,25 @@
1
1
  # Changelog — `@ai-matrx/meet`
2
2
 
3
+ ## 0.7.10
4
+ ### Unreleased
5
+ ### (next patch)
6
+
7
+ - **Fix — people in a meeting can HEAR each other** (production re-verification, 2026-09-29):
8
+ `livekit-client` never plays a remote audio track by itself, and nothing in this package
9
+ attached one, so every meeting received everyone's audio and played none of it. The LiveKit
10
+ driver now attaches every subscribed remote microphone to a hidden audio element in the
11
+ document (not tied to tiles, so a person on stage page two or in the Board overflow is still
12
+ heard) and removes it on unsubscribe and on disconnect.
13
+ - **Fix — a person admitted from the waiting room is no longer a black tile** for everyone
14
+ already inside: a tile rendered before its track was subscribed attached nothing and never
15
+ retried. `attach` now keeps listening for that participant's track and (re)attaches when it
16
+ is subscribed or republished; the returned cleanup stops listening.
17
+ - **Fix — link guests read "Guest" on the attendance report**, not "Member": the durable row
18
+ stores them as `participant` with no account, so "no account" now decides it.
19
+ - Guards: `src/core/livekit-driver.media.test.ts` (4 of 6 failed before the fix),
20
+ `after.test.ts` › "a link guest is a GUEST as the database stores them".
21
+ - **Consumer action:** none.
22
+
3
23
  ## 0.7.9
4
24
  ### (next patch)
5
25
 
package/dist/index.cjs CHANGED
@@ -3007,6 +3007,15 @@ function createLiveKitDriver(handlers, options = {}) {
3007
3007
  handlers.participants([local, ...remotes]);
3008
3008
  };
3009
3009
  projectRoster = roster;
3010
+ created.on(RoomEvent.TrackSubscribed, (track) => {
3011
+ if (track.kind !== Track.Kind.Audio || typeof document === "undefined") return;
3012
+ const element = track.attach();
3013
+ element.setAttribute("data-mx-meet-audio", "");
3014
+ audioSink().appendChild(element);
3015
+ }).on(RoomEvent.TrackUnsubscribed, (track) => {
3016
+ if (track.kind !== Track.Kind.Audio) return;
3017
+ for (const element of track.detach()) element.remove();
3018
+ });
3010
3019
  created.on(RoomEvent.ParticipantConnected, roster).on(RoomEvent.ParticipantDisconnected, roster).on(RoomEvent.TrackSubscribed, roster).on(RoomEvent.TrackUnsubscribed, roster).on(RoomEvent.TrackMuted, roster).on(RoomEvent.TrackUnmuted, roster).on(RoomEvent.LocalTrackPublished, roster).on(RoomEvent.LocalTrackUnpublished, roster).on(RoomEvent.ParticipantNameChanged, roster).on(RoomEvent.ParticipantAttributesChanged, roster).on(RoomEvent.ParticipantMetadataChanged, roster).on(RoomEvent.RoomMetadataChanged, (metadata) => {
3011
3020
  handlers.roomMetadata?.(metadata ?? "");
3012
3021
  }).on(RoomEvent.ActiveSpeakersChanged, (speakers) => {
@@ -3022,6 +3031,8 @@ function createLiveKitDriver(handlers, options = {}) {
3022
3031
  participant?.identity ?? null
3023
3032
  );
3024
3033
  }).on(RoomEvent.Disconnected, (reason) => {
3034
+ audioContainer?.remove();
3035
+ audioContainer = null;
3025
3036
  handlers.disconnected(reason === void 0 ? null : String(reason));
3026
3037
  });
3027
3038
  try {
@@ -3063,10 +3074,26 @@ function createLiveKitDriver(handlers, options = {}) {
3063
3074
  microphone: Track.Source.Microphone,
3064
3075
  screen: Track.Source.ScreenShare
3065
3076
  };
3077
+ trackEvents = {
3078
+ subscribed: RoomEvent.TrackSubscribed,
3079
+ localPublished: RoomEvent.LocalTrackPublished
3080
+ };
3066
3081
  room = created;
3067
3082
  return created;
3068
3083
  }
3069
3084
  let sources = null;
3085
+ let trackEvents = null;
3086
+ let audioContainer = null;
3087
+ function audioSink() {
3088
+ if (audioContainer !== null && audioContainer.isConnected) return audioContainer;
3089
+ const container = document.createElement("div");
3090
+ container.setAttribute("data-mx-meet-audio-sink", "");
3091
+ container.setAttribute("aria-hidden", "true");
3092
+ container.style.display = "none";
3093
+ document.body.appendChild(container);
3094
+ audioContainer = container;
3095
+ return container;
3096
+ }
3070
3097
  function requireRoom(operation) {
3071
3098
  if (room === null) {
3072
3099
  throw new MeetError(
@@ -3097,6 +3124,8 @@ function createLiveKitDriver(handlers, options = {}) {
3097
3124
  } catch {
3098
3125
  }
3099
3126
  projectRoster = null;
3127
+ audioContainer?.remove();
3128
+ audioContainer = null;
3100
3129
  await target.disconnect();
3101
3130
  },
3102
3131
  async setMicrophoneEnabled(enabled) {
@@ -3162,14 +3191,33 @@ function createLiveKitDriver(handlers, options = {}) {
3162
3191
  attach(identity, kind, element) {
3163
3192
  const target = requireRoom("attach");
3164
3193
  const source = sources?.[kind];
3165
- const participant = target.localParticipant.identity === identity ? target.localParticipant : target.remoteParticipants.get(identity);
3166
- if (participant === void 0 || source === void 0) return () => void 0;
3167
- const publication = participant.getTrackPublication(source);
3168
- const track = publication?.track;
3169
- if (track === void 0) return () => void 0;
3170
- track.attach(element);
3194
+ if (source === void 0) return () => void 0;
3195
+ let current = null;
3196
+ const sync = () => {
3197
+ const participant = target.localParticipant.identity === identity ? target.localParticipant : target.remoteParticipants.get(identity);
3198
+ const track = participant?.getTrackPublication(source)?.track;
3199
+ if (track === void 0 || track === current) return;
3200
+ current?.detach(element);
3201
+ track.attach(element);
3202
+ current = track;
3203
+ };
3204
+ const onTrack = (...args) => {
3205
+ const who = args[args.length - 1];
3206
+ if (who?.identity === identity) sync();
3207
+ };
3208
+ sync();
3209
+ const events = trackEvents;
3210
+ if (events !== null) {
3211
+ target.on(events.subscribed, onTrack);
3212
+ target.on(events.localPublished, onTrack);
3213
+ }
3171
3214
  return () => {
3172
- track.detach(element);
3215
+ if (events !== null) {
3216
+ target.off(events.subscribed, onTrack);
3217
+ target.off(events.localPublished, onTrack);
3218
+ }
3219
+ current?.detach(element);
3220
+ current = null;
3173
3221
  };
3174
3222
  },
3175
3223
  activeDevices() {
@@ -4098,6 +4146,7 @@ function kindOf(person) {
4098
4146
  if (person.role === "host") return "host";
4099
4147
  if (person.role === "cohost") return "cohost";
4100
4148
  if (person.role === "guest") return person.userId !== null ? "signed-in guest" : "guest";
4149
+ if (person.userId === null) return "guest";
4101
4150
  return "member";
4102
4151
  }
4103
4152
  function ms(iso) {