IAweb / index_peer.js
Tu Nombre
Actualización: Cambio a modelo Llama 3.1 8B
97c7a8c
Raw
History Blame Contribute Delete
577 Bytes
// PEERJS - Emisor
let peer;
let peerId = null;
function iniciarPeer() {
peer = new Peer({
host: '0.peerjs.com',
port: 443,
secure: true
});
peer.on('open', id => {
peerId = id;
document.getElementById('peerIdBox').textContent = 'ID: ' + id;
document.getElementById('peerIdBox').style.display = 'block';
});
peer.on('call', call => {
navigator.mediaDevices.getUserMedia({video: true, audio: true})
.then(stream => {
call.answer(stream);
agregarLog('Familiar conectado a la cámara ✓', 'info');
});
});
}