Browse Source

fix(lastN): Return the correct lastN value for the conference.

dev1
Jaya Allamsetty 4 years ago
parent
commit
dfe8007418
2 changed files with 11 additions and 2 deletions
  1. 2
    2
      JitsiConference.js
  2. 9
    0
      modules/qualitycontrol/ReceiveVideoController.js

+ 2
- 2
JitsiConference.js View File

@@ -1369,7 +1369,7 @@ JitsiConference.prototype.selectParticipants = function(participantIds) {
1369 1369
  * @returns {number}
1370 1370
  */
1371 1371
 JitsiConference.prototype.getLastN = function() {
1372
-    return this.rtc.getLastN();
1372
+    return this.receiveVideoController.getLastN();
1373 1373
 };
1374 1374
 
1375 1375
 /**
@@ -3033,7 +3033,7 @@ JitsiConference.prototype._setP2PStatus = function(newStatus) {
3033 3033
 
3034 3034
         // Sync up video transfer active in case p2pJingleSession not existed
3035 3035
         // when the lastN value was being adjusted.
3036
-        const isVideoActive = this.rtc.getLastN() !== 0;
3036
+        const isVideoActive = this.getLastN() !== 0;
3037 3037
 
3038 3038
         this.p2pJingleSession
3039 3039
             .setMediaTransferActive(true, isVideoActive)

+ 9
- 0
modules/qualitycontrol/ReceiveVideoController.js View File

@@ -183,6 +183,15 @@ export class ReceiveVideoController {
183 183
         this._maxFrameHeight && mediaSession.setReceiverVideoConstraint(this._maxFrameHeight);
184 184
     }
185 185
 
186
+    /**
187
+     * Returns the lastN value for the conference.
188
+     *
189
+     * @returns {number}
190
+     */
191
+    getLastN() {
192
+        return this._lastN;
193
+    }
194
+
186 195
     /**
187 196
      * Elects the participants with the given ids to be the selected participants in order to always receive video
188 197
      * for this participant (even when last n is enabled).

Loading…
Cancel
Save