|
@@ -1,4 +1,5 @@
|
1
|
1
|
import { getLogger } from 'jitsi-meet-logger';
|
|
2
|
+import isEqual from 'lodash.isequal';
|
2
|
3
|
|
3
|
4
|
import * as JitsiConferenceEvents from '../../JitsiConferenceEvents';
|
4
|
5
|
|
|
@@ -123,6 +124,23 @@ export class ReceiverVideoConstraints {
|
123
|
124
|
return changed;
|
124
|
125
|
}
|
125
|
126
|
|
|
127
|
+ /**
|
|
128
|
+ * Updates the receiver constraints sent to the bridge.
|
|
129
|
+ *
|
|
130
|
+ * @param {Object} videoConstraints
|
|
131
|
+ * @returns {boolean} Returns true if the the value has been updated, false otherwise.
|
|
132
|
+ */
|
|
133
|
+ updateReceiverVideoConstraints(videoConstraints) {
|
|
134
|
+ const changed = !isEqual(this._receiverVideoConstraints, videoConstraints);
|
|
135
|
+
|
|
136
|
+ if (changed) {
|
|
137
|
+ this._receiverVideoConstraints = videoConstraints;
|
|
138
|
+ logger.debug(`Updating ReceiverVideoConstraints ${JSON.stringify(videoConstraints)}`);
|
|
139
|
+ }
|
|
140
|
+
|
|
141
|
+ return changed;
|
|
142
|
+ }
|
|
143
|
+
|
126
|
144
|
/**
|
127
|
145
|
* Updates the list of selected endpoints.
|
128
|
146
|
*
|
|
@@ -257,4 +275,19 @@ export class ReceiveVideoController {
|
257
|
275
|
}
|
258
|
276
|
}
|
259
|
277
|
}
|
|
278
|
+
|
|
279
|
+ /**
|
|
280
|
+ * Sets the receiver constraints for the conference.
|
|
281
|
+ *
|
|
282
|
+ * @param {Object} constraints The video constraints.
|
|
283
|
+ */
|
|
284
|
+ setReceiverConstraints(constraints) {
|
|
285
|
+ if (!this._receiverVideoConstraints) {
|
|
286
|
+ this._receiverVideoConstraints = new ReceiverVideoConstraints();
|
|
287
|
+ }
|
|
288
|
+
|
|
289
|
+ const constraintsChanged = this._receiverVideoConstraints.updateReceiverVideoConstraints(constraints);
|
|
290
|
+
|
|
291
|
+ constraintsChanged && this._rtc.setNewReceiverVideoConstraints(constraints);
|
|
292
|
+ }
|
260
|
293
|
}
|