Update server

This commit is contained in:
Sergiu Toma 2022-11-24 16:46:00 +02:00
parent e59f134a68
commit c6edb2947d
3 changed files with 9 additions and 4 deletions

3
app.js
View File

@ -332,6 +332,8 @@ peers.on('connection', async socket => {
*/
socket.on('consume', async ({ rtpCapabilities }, callback) => {
try {
console.log(`[consume] rtpCapabilities: ${rtpCapabilities}`);
const callId = socketDetails[socket.id];
console.log('[consume] callId', callId);
@ -370,6 +372,7 @@ peers.on('connection', async socket => {
rtpParameters: videoCalls[callId].consumer.rtpParameters,
};
console.log('[consume] params', params);
// Send the parameters to the client
callback({ params });
} else {

View File

@ -20688,7 +20688,7 @@ const connectSendTransport = async () => {
// https://mediasoup.org/documentation/v3/mediasoup-client/api/#transport-produce
// this action will trigger the 'connect' and 'produce' events above
console.log('videoParams', videoParams);
producerVideo = await producerTransport.produce(videoParams)
console.log('producerVideo', producerVideo);
producerVideo.on('trackended', () => {
@ -20701,6 +20701,7 @@ const connectSendTransport = async () => {
// close video track
})
console.log('audioParams', audioParams);
producerAudio = await producerTransport.produce(audioParams)
console.log('producerAudio', producerAudio);
producerAudio.on('trackended', () => {

View File

@ -330,7 +330,7 @@ const connectSendTransport = async () => {
// https://mediasoup.org/documentation/v3/mediasoup-client/api/#transport-produce
// this action will trigger the 'connect' and 'produce' events above
console.log('videoParams', videoParams);
producerVideo = await producerTransport.produce(videoParams)
console.log('producerVideo', producerVideo);
producerVideo.on('trackended', () => {
@ -343,6 +343,7 @@ const connectSendTransport = async () => {
// close video track
})
console.log('audioParams', audioParams);
producerAudio = await producerTransport.produce(audioParams)
console.log('producerAudio', producerAudio);
producerAudio.on('trackended', () => {