cduss commited on
Commit
d24a79a
·
1 Parent(s): 92f8338
Files changed (1) hide show
  1. index.html +10 -8
index.html CHANGED
@@ -162,7 +162,7 @@
162
  </div>
163
 
164
  <script type="module">
165
- import { ReachyMini } from "https://cdn.jsdelivr.net/gh/pollen-robotics/reachy_mini@main/js/reachy-mini.js";
166
 
167
  const robot = new ReachyMini();
168
 
@@ -305,7 +305,8 @@
305
  const video = document.getElementById('remoteVideo');
306
  let bufLagMs = null;
307
  let rttMs = null;
308
- let jitterMs = null;
 
309
 
310
  // Buffer lag (how far behind live edge)
311
  if (video && video.buffered && video.buffered.length > 0) {
@@ -313,7 +314,7 @@
313
  bufLagMs = Math.round((end - video.currentTime) * 1000);
314
  }
315
 
316
- // WebRTC stats: RTT + jitter buffer delay
317
  if (robot._pc) {
318
  try {
319
  const stats = await robot._pc.getStats();
@@ -321,10 +322,10 @@
321
  if (report.type === 'candidate-pair' && report.currentRoundTripTime != null) {
322
  rttMs = Math.round(report.currentRoundTripTime * 1000);
323
  }
324
- if (report.type === 'inbound-rtp' && report.kind === 'video') {
325
- if (report.jitterBufferDelay != null && report.jitterBufferEmittedCount > 0) {
326
- jitterMs = Math.round((report.jitterBufferDelay / report.jitterBufferEmittedCount) * 1000);
327
- }
328
  }
329
  });
330
  } catch (_) { /* no stats yet */ }
@@ -334,7 +335,8 @@
334
  const parts = [];
335
  if (bufLagMs != null) parts.push(`buf ${bufLagMs}ms`);
336
  if (rttMs != null) parts.push(`rtt ${rttMs}ms`);
337
- if (jitterMs != null) parts.push(`jit ${jitterMs}ms`);
 
338
  label.textContent = parts.length ? parts.join(' · ') : '--';
339
 
340
  // Color based on buffer lag
 
162
  </div>
163
 
164
  <script type="module">
165
+ import { ReachyMini } from "https://cdn.jsdelivr.net/gh/pollen-robotics/reachy_mini@fix/js-app-latency/js/reachy-mini.js";
166
 
167
  const robot = new ReachyMini();
168
 
 
305
  const video = document.getElementById('remoteVideo');
306
  let bufLagMs = null;
307
  let rttMs = null;
308
+ let vidJitterMs = null;
309
+ let audJitterMs = null;
310
 
311
  // Buffer lag (how far behind live edge)
312
  if (video && video.buffered && video.buffered.length > 0) {
 
314
  bufLagMs = Math.round((end - video.currentTime) * 1000);
315
  }
316
 
317
+ // WebRTC stats: RTT + jitter buffer delay (video & audio)
318
  if (robot._pc) {
319
  try {
320
  const stats = await robot._pc.getStats();
 
322
  if (report.type === 'candidate-pair' && report.currentRoundTripTime != null) {
323
  rttMs = Math.round(report.currentRoundTripTime * 1000);
324
  }
325
+ if (report.type === 'inbound-rtp' && report.jitterBufferDelay != null && report.jitterBufferEmittedCount > 0) {
326
+ const jMs = Math.round((report.jitterBufferDelay / report.jitterBufferEmittedCount) * 1000);
327
+ if (report.kind === 'video') vidJitterMs = jMs;
328
+ if (report.kind === 'audio') audJitterMs = jMs;
329
  }
330
  });
331
  } catch (_) { /* no stats yet */ }
 
335
  const parts = [];
336
  if (bufLagMs != null) parts.push(`buf ${bufLagMs}ms`);
337
  if (rttMs != null) parts.push(`rtt ${rttMs}ms`);
338
+ if (vidJitterMs != null) parts.push(`v-jit ${vidJitterMs}ms`);
339
+ if (audJitterMs != null) parts.push(`a-jit ${audJitterMs}ms`);
340
  label.textContent = parts.length ? parts.join(' · ') : '--';
341
 
342
  // Color based on buffer lag