LINXD-2270-p2 #19
@ -20381,6 +20381,8 @@ let producerVideo
|
|||||||
let producerAudio
|
let producerAudio
|
||||||
let consumer
|
let consumer
|
||||||
let originAssetId
|
let originAssetId
|
||||||
|
let consumerVideo // local consumer video(consumer not transport)
|
||||||
|
let consumerAudio // local consumer audio(consumer not transport)
|
||||||
|
|
||||||
// https://mediasoup.org/documentation/v3/mediasoup-client/api/#ProducerOptions
|
// https://mediasoup.org/documentation/v3/mediasoup-client/api/#ProducerOptions
|
||||||
// https://mediasoup.org/documentation/v3/mediasoup-client/api/#transport-produce
|
// https://mediasoup.org/documentation/v3/mediasoup-client/api/#transport-produce
|
||||||
@ -20802,6 +20804,57 @@ const connectRecvTransport = async () => {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const getVideoTrask = async (videoParams) => {
|
||||||
|
consumerVideo = await consumerTransport.consume({
|
||||||
|
id: videoParams.id,
|
||||||
|
producerId: videoParams.producerId,
|
||||||
|
kind: videoParams.kind,
|
||||||
|
rtpParameters: videoParams.rtpParameters
|
||||||
|
})
|
||||||
|
|
||||||
|
consumerVideo.on('transportclose', () => {
|
||||||
|
console.log('transport closed so consumer closed')
|
||||||
|
})
|
||||||
|
|
||||||
|
return consumerVideo.track
|
||||||
|
}
|
||||||
|
|
||||||
|
const getAudioTrask = async (audioParams) => {
|
||||||
|
consumerAudio = await consumerTransport.consume({
|
||||||
|
id: audioParams.id,
|
||||||
|
producerId: audioParams.producerId,
|
||||||
|
kind: audioParams.kind,
|
||||||
|
rtpParameters: audioParams.rtpParameters
|
||||||
|
})
|
||||||
|
|
||||||
|
consumerAudio.on('transportclose', () => {
|
||||||
|
console.log('transport closed so consumer closed')
|
||||||
|
})
|
||||||
|
|
||||||
|
const audioTrack = consumerAudio.track
|
||||||
|
|
||||||
|
audioTrack.applyConstraints({
|
||||||
|
audio: {
|
||||||
|
advanced: [
|
||||||
|
{
|
||||||
|
echoCancellation: {exact: true}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
autoGainControl: {exact: true}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
noiseSuppression: {exact: true}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
highpassFilter: {exact: true}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
return audioTrack
|
||||||
|
}
|
||||||
|
|
||||||
const closeCall = () => {
|
const closeCall = () => {
|
||||||
console.log('closeCall');
|
console.log('closeCall');
|
||||||
|
|
||||||
|
@ -23,6 +23,8 @@ let producerVideo
|
|||||||
let producerAudio
|
let producerAudio
|
||||||
let consumer
|
let consumer
|
||||||
let originAssetId
|
let originAssetId
|
||||||
|
let consumerVideo // local consumer video(consumer not transport)
|
||||||
|
let consumerAudio // local consumer audio(consumer not transport)
|
||||||
|
|
||||||
// https://mediasoup.org/documentation/v3/mediasoup-client/api/#ProducerOptions
|
// https://mediasoup.org/documentation/v3/mediasoup-client/api/#ProducerOptions
|
||||||
// https://mediasoup.org/documentation/v3/mediasoup-client/api/#transport-produce
|
// https://mediasoup.org/documentation/v3/mediasoup-client/api/#transport-produce
|
||||||
@ -444,6 +446,57 @@ const connectRecvTransport = async () => {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const getVideoTrask = async (videoParams) => {
|
||||||
|
consumerVideo = await consumerTransport.consume({
|
||||||
|
id: videoParams.id,
|
||||||
|
producerId: videoParams.producerId,
|
||||||
|
kind: videoParams.kind,
|
||||||
|
rtpParameters: videoParams.rtpParameters
|
||||||
|
})
|
||||||
|
|
||||||
|
consumerVideo.on('transportclose', () => {
|
||||||
|
console.log('transport closed so consumer closed')
|
||||||
|
})
|
||||||
|
|
||||||
|
return consumerVideo.track
|
||||||
|
}
|
||||||
|
|
||||||
|
const getAudioTrask = async (audioParams) => {
|
||||||
|
consumerAudio = await consumerTransport.consume({
|
||||||
|
id: audioParams.id,
|
||||||
|
producerId: audioParams.producerId,
|
||||||
|
kind: audioParams.kind,
|
||||||
|
rtpParameters: audioParams.rtpParameters
|
||||||
|
})
|
||||||
|
|
||||||
|
consumerAudio.on('transportclose', () => {
|
||||||
|
console.log('transport closed so consumer closed')
|
||||||
|
})
|
||||||
|
|
||||||
|
const audioTrack = consumerAudio.track
|
||||||
|
|
||||||
|
audioTrack.applyConstraints({
|
||||||
|
audio: {
|
||||||
|
advanced: [
|
||||||
|
{
|
||||||
|
echoCancellation: {exact: true}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
autoGainControl: {exact: true}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
noiseSuppression: {exact: true}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
highpassFilter: {exact: true}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
return audioTrack
|
||||||
|
}
|
||||||
|
|
||||||
const closeCall = () => {
|
const closeCall = () => {
|
||||||
console.log('closeCall');
|
console.log('closeCall');
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user