ソースを参照

ref(video-quality): cache max frame height and send on channel open (#785)

* ref(video-quality): cache max frame height and send on channel open

Currently it is possible to try to change the max receive video
frame height before the data channel is open. In that case an error
will be thrown. This change makes it so that the desired frame height
is saved and sent on channel open, avoiding the thrown error the
max receive video frame height logic is exercised through the
JitsiConference api.

* squash: do the second part of the actual fix
tags/v0.0.2
virtuacoplenny 7年前
コミット
a9b8419cba
コミッターのメールアドレスに関連付けられたアカウントが存在しません
1個のファイルの変更21行の追加3行の削除
  1. 21
    3
      modules/RTC/RTC.js

+ 21
- 3
modules/RTC/RTC.js ファイルの表示

@@ -161,6 +161,15 @@ export default class RTC extends Listenable {
161 161
          */
162 162
         this._lastNEndpoints = null;
163 163
 
164
+        /**
165
+         * The number representing the maximum video height the local client
166
+         * should receive from the bridge.
167
+         *
168
+         * @type {number|undefined}
169
+         * @private
170
+         */
171
+        this._maxFrameHeight = undefined;
172
+
164 173
         /**
165 174
          * The endpoint ID of currently pinned participant or <tt>null</tt> if
166 175
          * no user is pinned.
@@ -251,11 +260,17 @@ export default class RTC extends Listenable {
251 260
                     this._pinnedEndpoint);
252 261
                 this._channel.sendSelectedEndpointMessage(
253 262
                     this._selectedEndpoint);
263
+
264
+                if (typeof this._maxFrameHeight !== 'undefined') {
265
+                    this._channel.sendReceiverVideoConstraintMessage(
266
+                        this._maxFrameHeight);
267
+                }
254 268
             } catch (error) {
255 269
                 GlobalOnErrorHandler.callErrorHandler(error);
256 270
                 logger.error(
257 271
                     `Cannot send selected(${this._selectedEndpoint})`
258
-                    + `pinned(${this._pinnedEndpoint}) endpoint message.`,
272
+                    + `pinned(${this._pinnedEndpoint})`
273
+                    + `frameHeight(${this._maxFrameHeight}) endpoint message`,
259 274
                     error);
260 275
             }
261 276
 
@@ -327,14 +342,17 @@ export default class RTC extends Listenable {
327 342
 
328 343
     /**
329 344
      * Sets the maximum video size the local participant should receive from
330
-     * remote participants. Will no-op if no data channel has been established.
345
+     * remote participants. Will cache the value and send it through the channel
346
+     * once it is created.
331 347
      *
332 348
      * @param {number} maxFrameHeightPixels the maximum frame height, in pixels,
333 349
      * this receiver is willing to receive.
334 350
      * @returns {void}
335 351
      */
336 352
     setReceiverVideoConstraint(maxFrameHeight) {
337
-        if (this._channel) {
353
+        this._maxFrameHeight = maxFrameHeight;
354
+
355
+        if (this._channel && this._channelOpen) {
338 356
             this._channel.sendReceiverVideoConstraintMessage(maxFrameHeight);
339 357
         }
340 358
     }

読み込み中…
キャンセル
保存