mirror of
https://github.com/Monadical-SAS/reflector.git
synced 2025-12-20 20:29:06 +00:00
no need to stop from server
This commit is contained in:
@@ -89,7 +89,7 @@ export default function Recorder(props) {
|
||||
const handleRecClick = async () => {
|
||||
if (!record) return console.log("no record");
|
||||
|
||||
if (record?.isRecording()) {
|
||||
if (record.isRecording()) {
|
||||
props.onStop();
|
||||
record.stopRecording();
|
||||
setIsRecording(false);
|
||||
|
||||
@@ -3,7 +3,7 @@ import Peer from "simple-peer";
|
||||
|
||||
const WebRTC_SERVER_URL = "http://127.0.0.1:1250/offer";
|
||||
|
||||
const useWebRTC = (stream, setIsRecording) => {
|
||||
const useWebRTC = (stream) => {
|
||||
const [data, setData] = useState({
|
||||
peer: null,
|
||||
});
|
||||
@@ -66,7 +66,6 @@ const useWebRTC = (stream, setIsRecording) => {
|
||||
},
|
||||
text: ''
|
||||
}));
|
||||
setIsRecording(false);
|
||||
break;
|
||||
default:
|
||||
console.error(`Unknown command ${serverData.cmd}`);
|
||||
@@ -76,7 +75,7 @@ const useWebRTC = (stream, setIsRecording) => {
|
||||
return () => {
|
||||
peer.destroy();
|
||||
};
|
||||
}, [stream, setIsRecording]);
|
||||
}, [stream]);
|
||||
|
||||
return data;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user