Skip to content

Commit 6abd742

Browse files
authored
feat: Disable p2p when transcribing is enabled. (#2812)
* feat: Disable p2p when transcribing is enabled.
1 parent 36ba9c6 commit 6abd742

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

JitsiConference.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2656,6 +2656,15 @@ JitsiConference.prototype.setStartMutedPolicy = function(policy) {
26562656
});
26572657
};
26582658

2659+
/** Set the transcribingEnabled flag. When transcribing is enabled p2p is
2660+
* disabled. */
2661+
JitsiConference.prototype._setTranscribingEnabled = function(enabled) {
2662+
if (this._transcribingEnabled !== enabled) {
2663+
this._transcribingEnabled = enabled;
2664+
this._maybeStartOrStopP2P(true);
2665+
}
2666+
};
2667+
26592668
/**
26602669
* Updates conference startMuted policy if needed and fires an event.
26612670
*
@@ -3495,7 +3504,7 @@ JitsiConference.prototype._shouldBeInP2PMode = function() {
34953504
const peers = this.getParticipants();
34963505
const peerCount = peers.length;
34973506
const hasBotPeer = peers.find(p => p.getBotType() === 'poltergeist' || p.hasFeature(FEATURE_JIGASI)) !== undefined;
3498-
const shouldBeInP2P = peerCount === 1 && !hasBotPeer && !this._hasVisitors;
3507+
const shouldBeInP2P = peerCount === 1 && !hasBotPeer && !this._hasVisitors && !this._transcribingEnabled;
34993508

35003509
logger.debug(`P2P? peerCount: ${peerCount}, hasBotPeer: ${hasBotPeer} => ${shouldBeInP2P}`);
35013510

JitsiConferenceEventManager.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -412,6 +412,9 @@ export default class JitsiConferenceEventManager {
412412
video && (conference.isVideoMutedByFocus = true);
413413
conference._updateStartMutedPolicy(audio, video);
414414
}
415+
if (metadata.recording && typeof metadata.recording.isTranscribingEnabled !== 'undefined') {
416+
conference._setTranscribingEnabled(Boolean(metadata.recording.isTranscribingEnabled));
417+
}
415418
conference.eventEmitter.emit(JitsiConferenceEvents.METADATA_UPDATED, metadata);
416419
});
417420
}

0 commit comments

Comments
 (0)