LH-265-enable-audio-in-mediasoup #16
3
app.js
3
app.js
@ -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 {
|
||||
|
@ -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', () => {
|
||||
@ -20710,7 +20711,7 @@ const connectSendTransport = async () => {
|
||||
|
||||
producerAudio.on('transportclose', () => {
|
||||
console.log('transport ended')
|
||||
|
||||
|
||||
// close video track
|
||||
})
|
||||
|
||||
|
@ -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', () => {
|
||||
@ -352,7 +353,7 @@ const connectSendTransport = async () => {
|
||||
|
||||
producerAudio.on('transportclose', () => {
|
||||
console.log('transport ended')
|
||||
|
||||
|
||||
// close video track
|
||||
})
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user