Celianv2 commited on
Commit
d2e5e94
·
verified ·
1 Parent(s): 5e98e17

fix audio js

Browse files
Files changed (1) hide show
  1. jericho/static/main.js +3 -9
jericho/static/main.js CHANGED
@@ -1,7 +1,7 @@
1
  let currentLoadedProject = null;
2
  let syncTimer = null;
3
  let lastSyncSent = 0;
4
- const SYNC_INTERVAL_MS = 250;
5
 
6
  const robotStatus = document.getElementById('robot-status');
7
  const videoPlayer = document.getElementById('video-player');
@@ -336,13 +336,7 @@ videoPlayer.addEventListener('seeked', () => {
336
  });
337
 
338
  videoPlayer.addEventListener('timeupdate', () => {
339
- if (!currentLoadedProject || videoPlayer.paused || videoPlayer.ended) return;
340
-
341
- const now = Date.now();
342
- if (now - lastSyncSent >= SYNC_INTERVAL_MS) {
343
- lastSyncSent = now;
344
- sendPlayback('sync', { playing: true });
345
- }
346
  });
347
 
348
  videoPlayer.addEventListener('ended', () => {
@@ -380,7 +374,7 @@ function createEmotionRow() {
380
 
381
  const btnRemove = document.createElement('button');
382
  btnRemove.textContent = '✗';
383
- btnRemove.style.background = '#c77981';
384
  btnRemove.style.color = 'white';
385
  btnRemove.style.border = 'none';
386
  btnRemove.style.cursor = 'pointer';
 
1
  let currentLoadedProject = null;
2
  let syncTimer = null;
3
  let lastSyncSent = 0;
4
+ const SYNC_INTERVAL_MS = 500;
5
 
6
  const robotStatus = document.getElementById('robot-status');
7
  const videoPlayer = document.getElementById('video-player');
 
336
  });
337
 
338
  videoPlayer.addEventListener('timeupdate', () => {
339
+ // synchro geree par startSyncLoop(), ici pas de double envoi
 
 
 
 
 
 
340
  });
341
 
342
  videoPlayer.addEventListener('ended', () => {
 
374
 
375
  const btnRemove = document.createElement('button');
376
  btnRemove.textContent = '✗';
377
+ btnRemove.style.background = '#e74c3c';
378
  btnRemove.style.color = 'white';
379
  btnRemove.style.border = 'none';
380
  btnRemove.style.cursor = 'pointer';