LINXD-2209: Added logs on consume

This commit is contained in:
Sergiu Toma 2022-09-13 21:15:51 +03:00
parent ab685270f1
commit accf960aa7

4
app.js
View File

@ -205,6 +205,7 @@ peers.on('connection', async socket => {
}) })
socket.on('consume', async ({ rtpCapabilities, callId }, callback) => { socket.on('consume', async ({ rtpCapabilities, callId }, callback) => {
console.log('[consume] callId', callId);
try { try {
// console.log('consume', rtpCapabilities, callId); // console.log('consume', rtpCapabilities, callId);
// check if the router can consume the specified producer // check if the router can consume the specified producer
@ -212,6 +213,7 @@ peers.on('connection', async socket => {
producerId: producer.id, producerId: producer.id,
rtpCapabilities rtpCapabilities
})) { })) {
console.log('[consume] Can consume', callId);
// transport can now consume and return a consumer // transport can now consume and return a consumer
consumer = await consumerTransport.consume({ consumer = await consumerTransport.consume({
producerId: producer.id, producerId: producer.id,
@ -252,7 +254,7 @@ peers.on('connection', async socket => {
callback({ params }) callback({ params })
} }
} catch (error) { } catch (error) {
console.log(error.message) console.log('[consume] Can\'t consume', error.message)
callback({ callback({
params: { params: {
error: error error: error