LH-265-enable-audio-in-mediasoup #16

Closed
sergiu wants to merge 120 commits from LH-265-enable-audio-in-mediasoup into master
3 changed files with 35 additions and 23 deletions
Showing only changes of commit 6e74083733 - Show all commits

4
app.js
View File

@ -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,

View File

@ -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')),

View File

@ -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')),