LH-265-enable-audio-in-mediasoup #16
4
app.js
4
app.js
@ -285,7 +285,9 @@ peers.on('connection', async socket => {
|
||||
const callId = socketDetails[socket.id];
|
||||
if (typeof rtpParameters === 'string') rtpParameters = JSON.parse(rtpParameters);
|
||||
|
||||
console.log('[transport-produce] | socket.id', socket.id, '| callId', callId);
|
||||
console.log(`[transport-produce] kind: ${kind} | socket.id: ${socket.id} | callId: ${callId}`);
|
||||
console.log('kind', kind);
|
||||
console.log('rtpParameters', rtpParameters);
|
||||
videoCalls[callId].producer = await videoCalls[callId].producerTransport.produce({
|
||||
kind,
|
||||
rtpParameters,
|
||||
|
@ -20687,17 +20687,6 @@ const connectSendTransport = async () => {
|
||||
// to send media to the Router
|
||||
// https://mediasoup.org/documentation/v3/mediasoup-client/api/#transport-produce
|
||||
// this action will trigger the 'connect' and 'produce' events above
|
||||
producerVideo = await producerTransport.produce(videoParams)
|
||||
console.log('producerVideo', producerVideo);
|
||||
producerVideo.on('trackended', () => {
|
||||
console.log('track ended')
|
||||
// close video track
|
||||
})
|
||||
|
||||
producerVideo.on('transportclose', () => {
|
||||
console.log('transport ended')
|
||||
// close video track
|
||||
})
|
||||
|
||||
producerAudio = await producerTransport.produce(audioParams)
|
||||
console.log('producerAudio', producerAudio);
|
||||
@ -20711,6 +20700,22 @@ const connectSendTransport = async () => {
|
||||
// close video track
|
||||
})
|
||||
|
||||
|
||||
|
||||
producerVideo = await producerTransport.produce(videoParams)
|
||||
console.log('producerVideo', producerVideo);
|
||||
producerVideo.on('trackended', () => {
|
||||
console.log('track ended')
|
||||
// close video track
|
||||
})
|
||||
|
||||
producerVideo.on('transportclose', () => {
|
||||
console.log('transport ended')
|
||||
// close video track
|
||||
})
|
||||
|
||||
|
||||
|
||||
const answer = {
|
||||
origin_asset_id: ASSET_ID,
|
||||
dest_asset_id: originAssetId || parseInt(urlParams.get('dest_asset_id')),
|
||||
|
@ -329,17 +329,6 @@ const connectSendTransport = async () => {
|
||||
// to send media to the Router
|
||||
// https://mediasoup.org/documentation/v3/mediasoup-client/api/#transport-produce
|
||||
// this action will trigger the 'connect' and 'produce' events above
|
||||
producerVideo = await producerTransport.produce(videoParams)
|
||||
console.log('producerVideo', producerVideo);
|
||||
producerVideo.on('trackended', () => {
|
||||
console.log('track ended')
|
||||
// close video track
|
||||
})
|
||||
|
||||
producerVideo.on('transportclose', () => {
|
||||
console.log('transport ended')
|
||||
// close video track
|
||||
})
|
||||
|
||||
producerAudio = await producerTransport.produce(audioParams)
|
||||
console.log('producerAudio', producerAudio);
|
||||
@ -353,6 +342,22 @@ const connectSendTransport = async () => {
|
||||
// close video track
|
||||
})
|
||||
|
||||
|
||||
|
||||
producerVideo = await producerTransport.produce(videoParams)
|
||||
console.log('producerVideo', producerVideo);
|
||||
producerVideo.on('trackended', () => {
|
||||
console.log('track ended')
|
||||
// close video track
|
||||
})
|
||||
|
||||
producerVideo.on('transportclose', () => {
|
||||
console.log('transport ended')
|
||||
// close video track
|
||||
})
|
||||
|
||||
|
||||
|
||||
const answer = {
|
||||
origin_asset_id: ASSET_ID,
|
||||
dest_asset_id: originAssetId || parseInt(urlParams.get('dest_asset_id')),
|
||||
|
Loading…
Reference in New Issue
Block a user