I might have a wrong understanding fo the local consumer create with the below code
const consumer: mediasoupClientTypes.Consumer = await this.recvTransport?.consume(
{
id,
producerId,
kind,
rtpParameters,
appData: { ...appData, peerId },
}
)
This works every time I close and open a view (reactjs component) showing the stream. Now, I have the impression that this is creating a connection to the server and since closing the view I donāt need this to waste bandwidth why not close the local consumer; so I am doing the below in my client.
const localConsumers = Array.from(this.consumers.values())
localConsumers.forEach((c) => c.close())
this.consumers = new Map()
But when I reopen the view I get the below and canāt seem to understand what is it asking; Iād normally assume here that it should just create a new consuming connection.
The error I see in the web console.
Uncaught (in promise) TypeError: Cannot read property 'push' of undefined
at OfferMediaSection.planBReceive (MediaSection.js:415)
at RemoteSdp.receive (RemoteSdp.js:130)
at Safari12.receive (Safari12.js:338)
at Object.task (Transport.js:303)
at AwaitQueue.<anonymous> (index.js:128)
at Generator.next (<anonymous>)
at index.js:8
at new Promise (<anonymous>)
at push../node_modules/awaitqueue/lib/index.js.__awaiter (index.js:4)
at AwaitQueue.executeTask (index.js:123)
at AwaitQueue.<anonymous> (index.js:115)
at Generator.next (<anonymous>)
at index.js:8
at new Promise (<anonymous>)
at push../node_modules/awaitqueue/lib/index.js.__awaiter (index.js:4)
at AwaitQueue.next (index.js:109)
at index.js:79
at new Promise (<anonymous>)
at AwaitQueue.<anonymous> (index.js:68)
at Generator.next (<anonymous>)
at index.js:8
at new Promise (<anonymous>)
at push../node_modules/awaitqueue/lib/index.js.__awaiter (index.js:4)
at AwaitQueue.push (index.js:57)
at Transport.consume (Transport.js:298)