@blockcast/mmt-transport 2.2.0-main.a88c3a0aa4f3 → 2.2.0-main.c4fa878f4ff4

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.
@@ -1656,8 +1656,10 @@
1656
1656
  if (!endpoint.endpointId || !Number.isFinite(endpoint.endpointVersion)) return false;
1657
1657
  if (!multicastEndpointSource(endpoint)) return false;
1658
1658
  if (!isValidMulticastGroupAddress(endpoint.groupAddress) || !Number.isInteger(endpoint.port) || endpoint.port <= 0 || endpoint.port > 65535 || !endpoint.tracks.length) return false;
1659
- const catalogTracks = /* @__PURE__ */ new Set([...Object.keys(catalog?.video?.renditions ?? {}), ...Object.keys(catalog?.audio?.renditions ?? {})]);
1660
- return endpoint.tracks.every((track) => !!track.name && isMulticastTrackPacketId(track.packetId) && (catalogTracks.size === 0 || catalogTracks.has(track.name) || catalogTracks.has(track.name.replace(/\/repair(?:\/\d+)?$/, ""))));
1659
+ const renditions = [catalog?.video?.renditions, catalog?.audio?.renditions].map((value) => value ?? {});
1660
+ const catalogTracks = new Set(renditions.flatMap((value) => Object.keys(value)));
1661
+ const fecRepairTracks = new Set(renditions.flatMap((value) => Object.values(value).flatMap((rendition) => [rendition?.fec].flat().map((instance) => instance?.repairTrack))).filter((name) => typeof name === "string"));
1662
+ return endpoint.tracks.every((track) => !!track.name && isMulticastTrackPacketId(track.packetId) && (catalogTracks.size === 0 || catalogTracks.has(track.name) || fecRepairTracks.has(track.name) || catalogTracks.has(track.name.replace(/\/repair(?:\/\d+)?$/, ""))));
1661
1663
  }
1662
1664
  function copyEndpoint(endpoint) {
1663
1665
  return { ...endpoint, tracks: endpoint.tracks.map((track) => ({ ...track })) };