djlspeed
(Cornelius)
January 3, 2022, 1:10am
1
Ahoy,
I refer to producers using their IDs and don’t know if I found something strange.
So I create the producer:
const producer = await someTransport.produce({...});
Then the producer.id is not the ID string (as it should be according to the docs, mediasoup :: API ), but an object containing an “id” property.
Am I referring to something wrong? Have I misread the docs?
Cheers,
Cornelius
nazar-pc
(Nazar Mokynskyi)
January 3, 2022, 8:19am
2
This means that arguments in {}
are likely incorrect, chck what those are
snnz
(Sergey Nozhenko)
January 3, 2022, 11:15am
3
Stringify the whole returned object: what is it?
djlspeed
(Cornelius)
January 3, 2022, 12:24pm
4
Thanks for your reply.
Here some code:
this.device = new mediasoup.Device();
// ...
this.sendTransport = this.device.createSendTransport({
id,
iceParameters,
iceCandidates,
dtlsParameters,
sctpParameters
});
//parameters from server response
// ...
this.audioProducer = await this.sendTransport.produce({
track,
codecOptions : {
opusStereo : 1,
opusDtx : 1
}
});
console.log(this.audioProducer.id)
// >> Object { id: "32c95f16-4116-4285-9bf1-6ccff421208d" }
I can just use this.audioProducer.id[“id”], but I’m confused that it doesn’t fit the docs (or at least what I read in them).
snnz
(Sergey Nozhenko)
January 3, 2022, 6:25pm
5
Check what you are passing to the callback in transport.on('produce', ...)
message handler. You probably receive the id
in an object from the signaling, and then envelop it in yet another object for the callback.
1 Like
djlspeed
(Cornelius)
January 3, 2022, 9:51pm
6
Genius!
That was the reason.
Thank you very much.