LINXD-2270: Removed console logs; Update commented code

This commit is contained in:
Sergiu Toma 2022-12-27 13:11:06 +02:00
parent b3409de3ba
commit 342d09c3e6

30
app.js
View File

@ -13,40 +13,40 @@ try {
}
const mediasoup = require('mediasoup');
let worker
let worker;
/**
*
* videoCalls - Dictionary of Object(s)
* '<callId>': {
* router: Router, router
* router: Router,
* initiatorAudioProducer: Producer,
* initiatorVideoProducer: Producer,
* receiverVideoProducer: Producer, producerVideo
* receiverAudioProducer: Producer, producerAudio
* receiverVideoProducer: Producer,
* receiverAudioProducer: Producer,
* initiatorProducerTransport: Producer Transport,
* receiverProducerTransport: Producer Transport, producerTransport
* initiatorConsumerVideo: Consumer, consumerVideo
* initiatorConsumerAudio: Consumer, consumerAudio
* initiatorConsumerTransport: Consumer Transport consumerTransport
* receiverProducerTransport: Producer Transport,
* initiatorConsumerVideo: Consumer,
* initiatorConsumerAudio: Consumer,
* initiatorConsumerTransport: Consumer Transport
* initiatorSockerId
* receiverSocketId
* }
*
**/
let videoCalls = {}
let socketDetails = {}
let videoCalls = {};
let socketDetails = {};
app.get('/', (_req, res) => {
res.send('Hello from mediasoup app!')
})
});
app.use('/sfu', express.static(path.join(__dirname, 'public')))
app.use('/sfu', express.static(path.join(__dirname, 'public')));
// SSL cert for HTTPS access
const options = {
key: fs.readFileSync(process.env.SERVER_KEY, 'utf-8'),
cert: fs.readFileSync(process.env.SERVER_CERT, 'utf-8'),
}
};
const httpsServer = https.createServer(options, app);
@ -225,7 +225,6 @@ peers.on('connection', async socket => {
*/
socket.on('createWebRtcTransport', async ({ sender }, callback) => {
try {
console.log('🟥', socket.id, JSON.stringify(sender));
const callId = socketDetails[socket.id];
console.log(`[createWebRtcTransport] socket ${socket.id} | sender ${sender} | callId ${callId}`);
if (sender) {
@ -429,7 +428,6 @@ peers.on('connection', async socket => {
} else if (!canConsumeVideo && canConsumeAudio) {
const audioParams = await consumeAudio(callId, socket.id, rtpCapabilities)
const data = { videoParams: null, audioParams };
console.log('-----------======= data', data);
callback(data);
} else {
console.log(`[consume] Can't consume | callId ${callId}`);
@ -459,8 +457,6 @@ peers.on('connection', async socket => {
(videoCalls[callId].receiverConsumerVideo) && await videoCalls[callId].receiverConsumerVideo.resume();
(videoCalls[callId].receiverConsumerVideo) && await videoCalls[callId].receiverConsumerAudio.resume();
}
// await videoCalls[callId].consumerVideo.resume();
// await videoCalls[callId].consumerAudio.resume();
} catch (error) {
console.log(`ERROR | consumer-resume | callId ${socketDetails[socket.id]} | ${error.message}`);
}