Compare commits
	
		
			No commits in common. "82f4868f78bb705e6af1fa130f6c7f0219293937" and "0a3a79aca90d69c387f3c2bf69f7667650987d56" have entirely different histories.
		
	
	
		
			82f4868f78
			...
			0a3a79aca9
		
	
		
| @ -54,25 +54,6 @@ function setProgress(e) { | |||||||
|   audio.currentTime = (clickX / width) * duration; |   audio.currentTime = (clickX / width) * duration; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| // Fonction pour regler la vitesse de lecture en fonction de la balle
 |  | ||||||
| function controlPlayback(speed) { |  | ||||||
|   if (speed > 0) { |  | ||||||
|     if (!isPlaying) { |  | ||||||
|       audio.play(); |  | ||||||
|       vinyl.style.animationPlayState = 'running'; |  | ||||||
|       isPlaying = true; |  | ||||||
|     } |  | ||||||
|     // Ajuste la vitesse de lecture audio (entre 0.5 et 2 par exemple)
 |  | ||||||
|     audio.playbackRate = Math.min(2, Math.max(0.5, speed)); |  | ||||||
|   } else { |  | ||||||
|     if (isPlaying) { |  | ||||||
|       audio.pause(); |  | ||||||
|       vinyl.style.animationPlayState = 'paused'; |  | ||||||
|       isPlaying = false; |  | ||||||
|     } |  | ||||||
|   } |  | ||||||
| } |  | ||||||
| 
 |  | ||||||
| // 4. Événements
 | // 4. Événements
 | ||||||
| 
 | 
 | ||||||
| // Clique sur le vinyle pour basculer lecture
 | // Clique sur le vinyle pour basculer lecture
 | ||||||
| @ -116,23 +97,3 @@ audio.addEventListener('ended', () => { | |||||||
|     isPlaying = false; |     isPlaying = false; | ||||||
|   } |   } | ||||||
| }); | }); | ||||||
| 
 |  | ||||||
| // server WebSocket
 |  | ||||||
| const WebSocket = require('ws'); |  | ||||||
| const wss = new WebSocket.Server({ port: 3000 }); |  | ||||||
| 
 |  | ||||||
| wss.on('connection', function connection(ws) { |  | ||||||
|   console.log('🟢 Un client WebSocket est connecté'); |  | ||||||
| 
 |  | ||||||
|   ws.on('message', function incoming(message) { |  | ||||||
|     console.log('📨 Message reçu:', message); |  | ||||||
|   }); |  | ||||||
| 
 |  | ||||||
|   ws.send('🔗 Connexion WebSocket établie avec le Raspberry Pi'); |  | ||||||
| }); |  | ||||||
| 
 |  | ||||||
| const socket = new WebSocket('ws://[IP_DU_PI]:8080'); |  | ||||||
| 
 |  | ||||||
| socket.onopen = () => console.log("✅ Connecté"); |  | ||||||
| socket.onmessage = e => console.log("📩 Message :", e.data); |  | ||||||
| socket.onerror = e => console.log("❌ Erreur :", e); |  | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user