mirror of
https://github.com/Monadical-SAS/reflector.git
synced 2025-12-21 04:39:06 +00:00
Stop command
This commit is contained in:
@@ -19,15 +19,12 @@ const App = () => {
|
||||
.getUserMedia({ audio: true })
|
||||
.then(setStream)
|
||||
.catch((err) => console.error(err));
|
||||
} else if (!recording) {
|
||||
if (stream) {
|
||||
const tracks = stream.getTracks();
|
||||
tracks.forEach((track) => track.stop());
|
||||
setStream(null);
|
||||
}
|
||||
} else if (!recording && serverData.peer) {
|
||||
serverData.peer.send(JSON.stringify({ cmd: 'STOP' }));
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
const serverData = useWebRTC(stream, setIsRecording);
|
||||
|
||||
return (
|
||||
|
||||
Reference in New Issue
Block a user