Skip to content

Commit a519f18

Browse files
committed
fix: Avoids p2p when there are visitors in the meeting.
1 parent ce486b8 commit a519f18

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

JitsiConference.js

+9-1
Original file line numberDiff line numberDiff line change
@@ -3074,6 +3074,13 @@ JitsiConference.prototype._updateProperties = function(properties = {}) {
30743074
});
30753075
}
30763076
});
3077+
3078+
const oldValue = this._hasVisitors;
3079+
3080+
this._hasVisitors = this.properties['visitor-count'] > 0;
3081+
3082+
// as this is visitor leaving, consider it leaving for _maybeStartOrStopP2P
3083+
oldValue && !this._hasVisitors && this._maybeStartOrStopP2P(true);
30773084
}
30783085
};
30793086

@@ -3266,7 +3273,8 @@ JitsiConference.prototype._maybeStartOrStopP2P = function(userLeftEvent) {
32663273
if (!this.isP2PEnabled()
32673274
|| this.isP2PTestModeEnabled()
32683275
|| (browser.isFirefox() && !this._firefoxP2pEnabled)
3269-
|| this.isE2EEEnabled()) {
3276+
|| this.isE2EEEnabled()
3277+
|| this._hasVisitors) {
32703278
logger.info('Auto P2P disabled');
32713279

32723280
return;

0 commit comments

Comments
 (0)