Update
This commit is contained in:
parent
b15357d089
commit
825ded83c2
@ -20381,6 +20381,8 @@ let producerVideo
|
||||
let producerAudio
|
||||
let consumer
|
||||
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/#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 = () => {
|
||||
console.log('closeCall');
|
||||
|
||||
|
@ -23,6 +23,8 @@ let producerVideo
|
||||
let producerAudio
|
||||
let consumer
|
||||
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/#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 = () => {
|
||||
console.log('closeCall');
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user