@webex/plugin-meetings 3.8.0-next.2 → 3.8.0-next.3

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.
@@ -1054,22 +1054,44 @@ export class RemoteMediaManager extends EventsScope {
1054
1054
  );
1055
1055
  }
1056
1056
 
1057
+ /**
1058
+ * Set multiple remote video CSIs at once
1059
+ * @param remoteMediaCsis The remote medias and CSIs to set them to
1060
+ * @returns {void}
1061
+ */
1062
+ public setRemoteVideoCsis(remoteMediaCsis: {remoteMedia: RemoteMedia; csi?: CSI | null}[]) {
1063
+ if (!remoteMediaCsis.length) {
1064
+ return;
1065
+ }
1066
+
1067
+ // Check all remote medias are known
1068
+ remoteMediaCsis.forEach(({remoteMedia}) => {
1069
+ if (!Object.values(this.media.video.memberPanes).includes(remoteMedia)) {
1070
+ throw new Error(`remoteMedia ${remoteMedia.id} not found`);
1071
+ }
1072
+ });
1073
+
1074
+ // Set remote video CSIs
1075
+ remoteMediaCsis.forEach(({remoteMedia, csi}) => {
1076
+ if (csi) {
1077
+ remoteMedia.sendMediaRequest(csi, false);
1078
+ } else {
1079
+ remoteMedia.cancelMediaRequest(false);
1080
+ }
1081
+ });
1082
+
1083
+ // Commit the changes
1084
+ this.mediaRequestManagers.video.commit();
1085
+ }
1086
+
1057
1087
  /**
1058
1088
  * Sets a new CSI on a given remote media object
1059
1089
  *
1060
1090
  * @param {RemoteMedia} remoteMedia remote Media object to modify
1061
1091
  * @param {CSI} csi new CSI value, can be null if we want to stop receiving media
1062
1092
  */
1063
- public setRemoteVideoCsi(remoteMedia: RemoteMedia, csi: CSI | null) {
1064
- if (!Object.values(this.media.video.memberPanes).includes(remoteMedia)) {
1065
- throw new Error('remoteMedia not found');
1066
- }
1067
-
1068
- if (csi) {
1069
- remoteMedia.sendMediaRequest(csi, true);
1070
- } else {
1071
- remoteMedia.cancelMediaRequest(true);
1072
- }
1093
+ public setRemoteVideoCsi(remoteMedia: RemoteMedia, csi?: CSI | null) {
1094
+ this.setRemoteVideoCsis([{remoteMedia, csi}]);
1073
1095
  }
1074
1096
 
1075
1097
  /**