@webex/web-client-media-engine 1.38.3 → 1.38.4

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/cjs/index.js CHANGED
@@ -10161,15 +10161,25 @@ class MultistreamConnection extends EventEmitter {
10161
10161
  requestMedia(mediaType, mediaRequests) {
10162
10162
  var _a;
10163
10163
  const task = () => {
10164
+ var _a;
10164
10165
  const jmpSession = this.jmpSessions.get(mediaType);
10165
10166
  if (!jmpSession) {
10166
10167
  logger.error(`Unable to find jmp session for ${mediaType}`);
10167
10168
  return;
10168
10169
  }
10169
- if (!mediaRequests.every((mr) => mr.receiveSlots.every((rs) => rs.id))) {
10170
- logger.error(`Running subscribe task, but ReceiveSlot ID is missing!`);
10171
- return;
10172
- }
10170
+ const requestedReceiveSlotIds = [];
10171
+ mediaRequests.forEach((mr) => mr.receiveSlots.forEach((rs) => {
10172
+ if (!rs.id) {
10173
+ logger.error(`Running subscribe task, but ReceiveSlot ID is missing!`);
10174
+ return;
10175
+ }
10176
+ requestedReceiveSlotIds.push(rs.id);
10177
+ }));
10178
+ (_a = this.recvTransceivers.get(mediaType)) === null || _a === void 0 ? void 0 : _a.forEach((transceiver) => {
10179
+ if (!requestedReceiveSlotIds.some((id) => compareStreamIds(id, transceiver.receiveSlot.id))) {
10180
+ transceiver.receiveSlot._updateSource('no source', undefined);
10181
+ }
10182
+ });
10173
10183
  jmpSession.sendRequests(mediaRequests.map((mr) => mr._toJmpScrRequest()));
10174
10184
  };
10175
10185
  if (((_a = this.dataChannel) === null || _a === void 0 ? void 0 : _a.readyState) === 'open') {