瀏覽代碼

Plumbing for e2e pings. (#1973)

* Plumbing for e2e pings.
* linter fixes
* Re-use existing event instead of introducing a new one.
dev1
George Politis 3 年之前
父節點
當前提交
3b38ab37f2
沒有連結到貢獻者的電子郵件帳戶。
共有 2 個檔案被更改,包括 5 行新增1 行删除
  1. 1
    1
      JitsiConference.js
  2. 4
    0
      modules/e2eping/e2eping.js

+ 1
- 1
JitsiConference.js 查看文件

134
     this.xmpp = this.connection?.xmpp;
134
     this.xmpp = this.connection?.xmpp;
135
 
135
 
136
     if (this.xmpp.isRoomCreated(options.name, options.customDomain)) {
136
     if (this.xmpp.isRoomCreated(options.name, options.customDomain)) {
137
-        const errmsg = 'A coference with the same name has already been created!';
137
+        const errmsg = 'A conference with the same name has already been created!';
138
 
138
 
139
         delete this.connection;
139
         delete this.connection;
140
         delete this.xmpp;
140
         delete this.xmpp;

+ 4
- 0
modules/e2eping/e2eping.js 查看文件

1
 import { getLogger } from '@jitsi/logger';
1
 import { getLogger } from '@jitsi/logger';
2
 
2
 
3
 import * as JitsiConferenceEvents from '../../JitsiConferenceEvents';
3
 import * as JitsiConferenceEvents from '../../JitsiConferenceEvents';
4
+import * as JitsiE2EPingEvents from '../../service/e2eping/E2ePingEvents';
4
 
5
 
5
 const logger = getLogger(__filename);
6
 const logger = getLogger(__filename);
6
 
7
 
160
             logger.info(`Measured RTT=${rtt} ms to ${this.id} (in ${this.participant.getProperty('region')})`);
161
             logger.info(`Measured RTT=${rtt} ms to ${this.id} (in ${this.participant.getProperty('region')})`);
161
             this.stop();
162
             this.stop();
162
 
163
 
164
+            this.e2eping.conference.eventEmitter.emit(
165
+                JitsiE2EPingEvents.E2E_RTT_CHANGED, this.participant, rtt);
166
+
163
             return;
167
             return;
164
         } else if (totalNumRequests > 2 * this.e2eping.numRequests) {
168
         } else if (totalNumRequests > 2 * this.e2eping.numRequests) {
165
             logger.info(`Stopping e2eping for ${this.id} because we sent ${totalNumRequests} with only `
169
             logger.info(`Stopping e2eping for ${this.id} because we sent ${totalNumRequests} with only `

Loading…
取消
儲存