test
This commit is contained in:
parent
c7049ef909
commit
1f3fbba5c0
53
app.js
53
app.js
@ -290,31 +290,36 @@ peers.on('connection', async socket => {
|
||||
|
||||
|
||||
|
||||
const router = videoCalls[callId].router;
|
||||
|
||||
router.observer.on("newtransport", (transport) => {
|
||||
transport.observer.on("newproducer", (producer) => {
|
||||
|
||||
console.log(
|
||||
"new producer created [worker.pid:%d, router.id:%s, transport.id:%s, producer.id:%s]",
|
||||
worker.pid, router.id, transport.id, producer.id
|
||||
);
|
||||
|
||||
if (!isInitiator(callId, socket.id)) {
|
||||
console.log('🟥 Emit to initiatorSocket');
|
||||
videoCalls[callId].initiatorSocket.emit('new-producer', {
|
||||
callId
|
||||
});
|
||||
|
||||
} else {
|
||||
console.log('🟥 Emit to receiverSocket');
|
||||
videoCalls[callId].receiverSocket.emit('new-producer', {
|
||||
callId
|
||||
});
|
||||
}
|
||||
try {
|
||||
const router = videoCalls[callId].router;
|
||||
|
||||
router.observer.on("newtransport", (transport) => {
|
||||
transport.observer.on("newproducer", (producer) => {
|
||||
|
||||
console.log(
|
||||
"new producer created [worker.pid:%d, router.id:%s, transport.id:%s, producer.id:%s]",
|
||||
worker.pid, router.id, transport.id, producer.id
|
||||
);
|
||||
|
||||
if (!isInitiator(callId, socket.id)) {
|
||||
console.log('🟥 Emit to initiatorSocket');
|
||||
videoCalls[callId].initiatorSocket.emit('new-producer', {
|
||||
callId
|
||||
});
|
||||
|
||||
} else {
|
||||
console.log('🟥 Emit to receiverSocket');
|
||||
videoCalls[callId].receiverSocket.emit('new-producer', {
|
||||
callId
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
} catch (error) {
|
||||
console.log('&&&&&&&&&&&&&&&&', error.message);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user