LH-276: Add close-producer event handler; Update client #30
15
app.js
15
app.js
@ -386,18 +386,13 @@ peers.on('connection', async (socket) => {
|
|||||||
- The consumer does consumerTransport.consume(params)
|
- The consumer does consumerTransport.consume(params)
|
||||||
*/
|
*/
|
||||||
socket.on('consume', async ({ rtpCapabilities }, callback) => {
|
socket.on('consume', async ({ rtpCapabilities }, callback) => {
|
||||||
try {
|
const callId = socketDetails[socket.id];
|
||||||
const callId = socketDetails[socket.id];
|
const socketId = socket.id;
|
||||||
const socketId = socket.id;
|
let audioParams, videoParams;
|
||||||
let audioParams, videoParams;
|
|
||||||
|
|
||||||
console.log(`[consume] socket ${socketId} | callId: ${callId}`);
|
console.log(`[consume] socket ${socketId} | callId: ${callId}`);
|
||||||
|
|
||||||
if (typeof rtpCapabilities === 'string') rtpCapabilities = JSON.parse(rtpCapabilities);
|
if (typeof rtpCapabilities === 'string') rtpCapabilities = JSON.parse(rtpCapabilities);
|
||||||
} catch (error) {
|
|
||||||
console.error(`[consume] | ERROR | callId: ${callId} | error: ${error.message}`);
|
|
||||||
callback({ params: { error } });
|
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
videoParams = await consumeVideo({ callId, socketId, rtpCapabilities });
|
videoParams = await consumeVideo({ callId, socketId, rtpCapabilities });
|
||||||
|
Loading…
Reference in New Issue
Block a user