Update server
This commit is contained in:
parent
c6edb2947d
commit
22ead926b0
6
app.js
6
app.js
@ -91,6 +91,7 @@ worker = createWorker();
|
|||||||
// list of media codecs supported by mediasoup ...
|
// list of media codecs supported by mediasoup ...
|
||||||
// https://github.com/versatica/mediasoup/blob/v3/src/supportedRtpCapabilities.ts
|
// https://github.com/versatica/mediasoup/blob/v3/src/supportedRtpCapabilities.ts
|
||||||
const mediaCodecs = [
|
const mediaCodecs = [
|
||||||
|
channels : 2,
|
||||||
{
|
{
|
||||||
kind : 'audio',
|
kind : 'audio',
|
||||||
mimeType : 'audio/opus',
|
mimeType : 'audio/opus',
|
||||||
@ -104,7 +105,8 @@ const mediaCodecs = [
|
|||||||
parameters :
|
parameters :
|
||||||
{
|
{
|
||||||
'x-google-start-bitrate' : 1000
|
'x-google-start-bitrate' : 1000
|
||||||
}
|
},
|
||||||
|
channels : 2
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
kind : 'video',
|
kind : 'video',
|
||||||
@ -333,7 +335,7 @@ peers.on('connection', async socket => {
|
|||||||
socket.on('consume', async ({ rtpCapabilities }, callback) => {
|
socket.on('consume', async ({ rtpCapabilities }, callback) => {
|
||||||
try {
|
try {
|
||||||
console.log(`[consume] rtpCapabilities: ${rtpCapabilities}`);
|
console.log(`[consume] rtpCapabilities: ${rtpCapabilities}`);
|
||||||
|
|
||||||
const callId = socketDetails[socket.id];
|
const callId = socketDetails[socket.id];
|
||||||
console.log('[consume] callId', callId);
|
console.log('[consume] callId', callId);
|
||||||
|
|
||||||
|
@ -20687,6 +20687,22 @@ const connectSendTransport = async () => {
|
|||||||
// to send media to the Router
|
// to send media to the Router
|
||||||
// https://mediasoup.org/documentation/v3/mediasoup-client/api/#transport-produce
|
// https://mediasoup.org/documentation/v3/mediasoup-client/api/#transport-produce
|
||||||
// this action will trigger the 'connect' and 'produce' events above
|
// this action will trigger the 'connect' and 'produce' events above
|
||||||
|
|
||||||
|
|
||||||
|
console.log('audioParams', audioParams);
|
||||||
|
producerAudio = await producerTransport.produce(audioParams)
|
||||||
|
console.log('producerAudio', producerAudio);
|
||||||
|
producerAudio.on('trackended', () => {
|
||||||
|
console.log('track ended')
|
||||||
|
// close video track
|
||||||
|
})
|
||||||
|
|
||||||
|
producerAudio.on('transportclose', () => {
|
||||||
|
console.log('transport ended')
|
||||||
|
|
||||||
|
// close video track
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
console.log('videoParams', videoParams);
|
console.log('videoParams', videoParams);
|
||||||
producerVideo = await producerTransport.produce(videoParams)
|
producerVideo = await producerTransport.produce(videoParams)
|
||||||
@ -20694,28 +20710,12 @@ const connectSendTransport = async () => {
|
|||||||
producerVideo.on('trackended', () => {
|
producerVideo.on('trackended', () => {
|
||||||
console.log('track ended')
|
console.log('track ended')
|
||||||
// close video track
|
// close video track
|
||||||
})
|
})
|
||||||
|
|
||||||
producerVideo.on('transportclose', () => {
|
producerVideo.on('transportclose', () => {
|
||||||
console.log('transport ended')
|
console.log('transport ended')
|
||||||
// close video track
|
// close video track
|
||||||
})
|
})
|
||||||
|
|
||||||
console.log('audioParams', audioParams);
|
|
||||||
producerAudio = await producerTransport.produce(audioParams)
|
|
||||||
console.log('producerAudio', producerAudio);
|
|
||||||
producerAudio.on('trackended', () => {
|
|
||||||
console.log('track ended')
|
|
||||||
// close video track
|
|
||||||
})
|
|
||||||
|
|
||||||
producerAudio.on('transportclose', () => {
|
|
||||||
console.log('transport ended')
|
|
||||||
|
|
||||||
// close video track
|
|
||||||
})
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -329,6 +329,22 @@ const connectSendTransport = async () => {
|
|||||||
// to send media to the Router
|
// to send media to the Router
|
||||||
// https://mediasoup.org/documentation/v3/mediasoup-client/api/#transport-produce
|
// https://mediasoup.org/documentation/v3/mediasoup-client/api/#transport-produce
|
||||||
// this action will trigger the 'connect' and 'produce' events above
|
// this action will trigger the 'connect' and 'produce' events above
|
||||||
|
|
||||||
|
|
||||||
|
console.log('audioParams', audioParams);
|
||||||
|
producerAudio = await producerTransport.produce(audioParams)
|
||||||
|
console.log('producerAudio', producerAudio);
|
||||||
|
producerAudio.on('trackended', () => {
|
||||||
|
console.log('track ended')
|
||||||
|
// close video track
|
||||||
|
})
|
||||||
|
|
||||||
|
producerAudio.on('transportclose', () => {
|
||||||
|
console.log('transport ended')
|
||||||
|
|
||||||
|
// close video track
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
console.log('videoParams', videoParams);
|
console.log('videoParams', videoParams);
|
||||||
producerVideo = await producerTransport.produce(videoParams)
|
producerVideo = await producerTransport.produce(videoParams)
|
||||||
@ -336,28 +352,12 @@ const connectSendTransport = async () => {
|
|||||||
producerVideo.on('trackended', () => {
|
producerVideo.on('trackended', () => {
|
||||||
console.log('track ended')
|
console.log('track ended')
|
||||||
// close video track
|
// close video track
|
||||||
})
|
})
|
||||||
|
|
||||||
producerVideo.on('transportclose', () => {
|
producerVideo.on('transportclose', () => {
|
||||||
console.log('transport ended')
|
console.log('transport ended')
|
||||||
// close video track
|
// close video track
|
||||||
})
|
})
|
||||||
|
|
||||||
console.log('audioParams', audioParams);
|
|
||||||
producerAudio = await producerTransport.produce(audioParams)
|
|
||||||
console.log('producerAudio', producerAudio);
|
|
||||||
producerAudio.on('trackended', () => {
|
|
||||||
console.log('track ended')
|
|
||||||
// close video track
|
|
||||||
})
|
|
||||||
|
|
||||||
producerAudio.on('transportclose', () => {
|
|
||||||
console.log('transport ended')
|
|
||||||
|
|
||||||
// close video track
|
|
||||||
})
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user