This commit is contained in:
Sergiu Toma 2022-12-19 11:21:02 +02:00
parent 2fbb355fea
commit 2c375c01ea
2 changed files with 38 additions and 36 deletions

View File

@ -20762,32 +20762,33 @@ const connectRecvTransport = async () => {
await socket.emit('consume', {
rtpCapabilities: device.rtpCapabilities,
callId
}, async ({ params }) => {
}, async (data) => {
console.log(`[consume] data ${data}`);
// if (params.error) {
// console.log('Cannot Consume')
// return
// }
console.log(`[connectRecvTransport] consume params ${params}`);
// console.log(`[connectRecvTransport] consume params ${params}`);
// Then consume with the local consumer transport
// which creates a consumer
consumer = await consumerTransport.consume({
id: params.id,
producerId: params.producerId,
kind: params.kind,
rtpParameters: params.rtpParameters
})
// // Then consume with the local consumer transport
// // which creates a consumer
// consumer = await consumerTransport.consume({
// id: params.id,
// producerId: params.producerId,
// kind: params.kind,
// rtpParameters: params.rtpParameters
// })
// destructure and retrieve the video track from the producer
const { track } = consumer
// // destructure and retrieve the video track from the producer
// const { track } = consumer
let stream = new MediaStream()
stream.addTrack(track)
// stream.removeTrack(track)
remoteVideo.srcObject = stream
socket.emit('consumer-resume')
console.log('consumer', consumer);
// let stream = new MediaStream()
// stream.addTrack(track)
// // stream.removeTrack(track)
// remoteVideo.srcObject = stream
// socket.emit('consumer-resume')
// console.log('consumer', consumer);
})
}

View File

@ -404,32 +404,33 @@ const connectRecvTransport = async () => {
await socket.emit('consume', {
rtpCapabilities: device.rtpCapabilities,
callId
}, async ({ params }) => {
}, async (data) => {
console.log(`[consume] data ${data}`);
// if (params.error) {
// console.log('Cannot Consume')
// return
// }
console.log(`[connectRecvTransport] consume params ${params}`);
// console.log(`[connectRecvTransport] consume params ${params}`);
// Then consume with the local consumer transport
// which creates a consumer
consumer = await consumerTransport.consume({
id: params.id,
producerId: params.producerId,
kind: params.kind,
rtpParameters: params.rtpParameters
})
// // Then consume with the local consumer transport
// // which creates a consumer
// consumer = await consumerTransport.consume({
// id: params.id,
// producerId: params.producerId,
// kind: params.kind,
// rtpParameters: params.rtpParameters
// })
// destructure and retrieve the video track from the producer
const { track } = consumer
// // destructure and retrieve the video track from the producer
// const { track } = consumer
let stream = new MediaStream()
stream.addTrack(track)
// stream.removeTrack(track)
remoteVideo.srcObject = stream
socket.emit('consumer-resume')
console.log('consumer', consumer);
// let stream = new MediaStream()
// stream.addTrack(track)
// // stream.removeTrack(track)
// remoteVideo.srcObject = stream
// socket.emit('consumer-resume')
// console.log('consumer', consumer);
})
}