@defcomm/meetingsdk 0.3.7 → 0.3.8

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/index.js CHANGED
@@ -1051,9 +1051,22 @@ var SFUClient = class {
1051
1051
  }
1052
1052
  }
1053
1053
  rememberTrack(track) {
1054
- this.trackMetadata.set(track.track_id, track);
1055
- this.trackToParticipant.set(track.track_id, track.participant_id);
1056
- if (track.source) this.trackToSource.set(track.track_id, track.source);
1054
+ if (!track?.track_id || !track?.participant_id) return;
1055
+ const normalizedSource = track.source ? String(track.source).trim().toLowerCase() : void 0;
1056
+ const normalized = {
1057
+ ...track,
1058
+ source: normalizedSource
1059
+ };
1060
+ this.trackMetadata.set(normalized.track_id, normalized);
1061
+ this.trackToParticipant.set(
1062
+ normalized.track_id,
1063
+ normalized.participant_id
1064
+ );
1065
+ if (normalizedSource) {
1066
+ this.trackToSource.set(normalized.track_id, normalizedSource);
1067
+ } else {
1068
+ this.trackToSource.delete(normalized.track_id);
1069
+ }
1057
1070
  }
1058
1071
  async handleJoined(payload) {
1059
1072
  const resumed = this.joiningWithResume;
@@ -1082,7 +1095,12 @@ var SFUClient = class {
1082
1095
  await this.initializePeerConnections();
1083
1096
  this.setState("connected");
1084
1097
  this.onConnected(payload, resumed);
1085
- if (payload.recording && payload.recording?.status === "recording") {
1098
+ if (payload.recording?.status === "recording") {
1099
+ console.log("[SFU] Recording already active when joining", {
1100
+ recording_id: payload.recording.recording_id,
1101
+ started_at: payload.recording.started_at,
1102
+ status: payload.recording.status
1103
+ });
1086
1104
  this.onRecordingStarted({
1087
1105
  recording_id: payload.recording.recording_id,
1088
1106
  started_at: payload.recording.started_at
@@ -1207,6 +1225,13 @@ var SFUClient = class {
1207
1225
  const source = String(
1208
1226
  metadata.source || this.trackToSource.get(metadata.track_id) || ""
1209
1227
  ).trim().toLowerCase();
1228
+ console.debug("[SFU] Remote track source resolved", {
1229
+ participantId,
1230
+ browserTrackId: event.track.id,
1231
+ serverTrackId: metadata.track_id,
1232
+ kind: event.track.kind,
1233
+ source
1234
+ });
1210
1235
  if (source === "screen" || source === "screen_share") {
1211
1236
  let screenStream = this.remoteScreenStreams.get(participantId);
1212
1237
  if (!screenStream) {
@@ -2470,8 +2495,8 @@ var VideoSDKCore = class {
2470
2495
  if (!participantId || participantId === this.myId) {
2471
2496
  return;
2472
2497
  }
2473
- const source = metadata.source;
2474
- if (source === "screen") {
2498
+ const source = String(metadata.source || "").trim().toLowerCase();
2499
+ if (source === "screen" || source === "screen_share") {
2475
2500
  let screenStream = this.remoteScreenStreams.get(participantId);
2476
2501
  if (!screenStream) {
2477
2502
  screenStream = new MediaStream();