Close pc as well

This commit is contained in:
Nick Mowen 2023-10-20 16:13:45 -06:00
parent 5deda8a855
commit 5fbf43d352

View File

@ -85,6 +85,10 @@ export default function WebRtcPlayer({ camera, width, height }) {
pc.setRemoteDescription({ type: 'answer', sdp: msg.value });
}
});
ws.addEventListener('close', () => {
pc.close();
})
}, [PeerConnection, ws]);
useEffect(() => {