# Media track received in consumer but unable to play

**URL:** <https://mediasoup.discourse.group/t/media-track-received-in-consumer-but-unable-to-play/5846>\
**Category:** mediasoup libraries\
**Created:** [February 14, 2024, 6:28am UTC](https://mediasoup.discourse.group/t/media-track-received-in-consumer-but-unable-to-play/5846 "2024-02-14T06:28:57Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![mactovish](https://yyz2.discourse-cdn.com/free1/user_avatar/mediasoup.discourse.group/mactovish/32/2522_2.png) [@mactovish](https://mediasoup.discourse.group/u/mactovish)\
**Post date:** [February 14, 2024, 6:28am UTC](https://mediasoup.discourse.group/t/media-track-received-in-consumer-but-unable-to-play/5846/1 "2024-02-14T06:28:57Z")

</div>

- I have a single WebRTC **Transport** object in my server, and as per the docs it can handle both consuming and producing on server side.
- On my client side I have a **producer transport,** and a **consumer transport.** …both of them generate dtls params, {role, dtlsFingerprints} _“on connect”_ which equates to **role:client, dtlsFingerprints: algo:… , value:… ;**
- Both these _dtls params are different_.
- In my server code i have a **transport.connect** method that takes in these dtls params after being signalled from client side. (currently i am not signalling the client consumer dtls params to the server **transport.connect** () .
- How can the same transport object be configured to have multiple [sender and reciever] dtls params?  
**[problem: i am receiving a media track in my client consumer but it is not playing… i guess it is due to the encryption thing] need some insights…**

---

<div class="post-metadata">

**Author:** ![ibc](https://yyz2.discourse-cdn.com/free1/user_avatar/mediasoup.discourse.group/ibc/32/1540_2.png) [@ibc](https://mediasoup.discourse.group/u/ibc)\
**Post date:** [February 14, 2024, 9:29am UTC](https://mediasoup.discourse.group/t/media-track-received-in-consumer-but-unable-to-play/5846/2 "2024-02-14T09:29:22Z")

</div>

You have to create 2 transport in server side, one for each client side transport.

---

<div class="post-metadata">

**Author:** ![mactovish](https://yyz2.discourse-cdn.com/free1/user_avatar/mediasoup.discourse.group/mactovish/32/2522_2.png) [@mactovish](https://mediasoup.discourse.group/u/mactovish)\
**Post date:** [February 14, 2024, 3:33pm UTC](https://mediasoup.discourse.group/t/media-track-received-in-consumer-but-unable-to-play/5846/3 "2024-02-14T15:33:28Z")

</div>

I did. Still no luck.  
i have created two transports on the server side and on the client side. And on connect is done in client side for both transport and consumer in which i am signaling dtlsparams to server.  
in transport.produce where i need to send the audio track and codec and encodings (from the client [browser] ) , I am passing only track… I have no idea what codec or encoding to pass here.  
In the mediasoup server while creating the router I am passing the following as mediaCodecs :  
[  
{  
kind: ‘audio’,  
mimeType: ‘audio/opus’,  
clockRate: 48000,  
channels: 2,  
},  
{  
kind: ‘video’,  
mimeType: ‘video/VP8’,  
clockRate: 90000,  
parameters: {  
‘x-google-start-bitrate’: 1000,  
},  
},  
]

---

<div class="post-metadata">

**Author:** ![ibc](https://yyz2.discourse-cdn.com/free1/user_avatar/mediasoup.discourse.group/ibc/32/1540_2.png) [@ibc](https://mediasoup.discourse.group/u/ibc)\
**Post date:** [February 14, 2024, 4:30pm UTC](https://mediasoup.discourse.group/t/media-track-received-in-consumer-but-unable-to-play/5846/4 "2024-02-14T16:30:07Z")

</div>

Verify that the ICE and DTLS states of the transports are connected. There is API for that in server and client side.

---

<div class="post-metadata">

**Author:** ![mactovish](https://yyz2.discourse-cdn.com/free1/user_avatar/mediasoup.discourse.group/mactovish/32/2522_2.png) [@mactovish](https://mediasoup.discourse.group/u/mactovish)\
**Post date:** [February 15, 2024, 3:32pm UTC](https://mediasoup.discourse.group/t/media-track-received-in-consumer-but-unable-to-play/5846/5 "2024-02-15T15:32:25Z")

</div>

your intuition was right… the producer transport does not get connected [on client side]. it fails.  
here is my handlers of on produce and on connect… what could be the possible reason for this

 ![image](https://global.discourse-cdn.com/free1/uploads/mediasoup/original/2X/5/59d32930f48d21b1731c9350793640b4d3bae64d.png)

---

<div class="post-metadata">

**Author:** ![snnz](https://yyz2.discourse-cdn.com/free1/user_avatar/mediasoup.discourse.group/snnz/32/693_2.png) [@snnz](https://mediasoup.discourse.group/u/snnz)\
**Post date:** [February 15, 2024, 4:35pm UTC](https://mediasoup.discourse.group/t/media-track-received-in-consumer-but-unable-to-play/5846/6 "2024-02-15T16:35:17Z")

</div>

I wonder what does `this.voiceComService.getProducerID().subscribe(...)` mean?  
Judging by its name, `getProducerID()` looks like a function returning none other than producer’s id (a string).

---

<div class="post-metadata">

**Author:** ![mactovish](https://yyz2.discourse-cdn.com/free1/user_avatar/mediasoup.discourse.group/mactovish/32/2522_2.png) [@mactovish](https://mediasoup.discourse.group/u/mactovish)\
**Post date:** [February 15, 2024, 4:58pm UTC](https://mediasoup.discourse.group/t/media-track-received-in-consumer-but-unable-to-play/5846/7 "2024-02-15T16:58:12Z")

</div>

Thanks a lot. that worked… for me… i checked if the connection is getting connected or not with :

 ![image](https://global.discourse-cdn.com/free1/uploads/mediasoup/original/2X/0/024c2f81abb10f05b6fa43ebef1647e707d1c25c.png)

Then i changed listenIps to listenInfos and it worked…it got connected …  
And the voice tranfer was successful …great it worked !!

---

<div class="post-metadata">

**Author:** ![mactovish](https://yyz2.discourse-cdn.com/free1/user_avatar/mediasoup.discourse.group/mactovish/32/2522_2.png) [@mactovish](https://mediasoup.discourse.group/u/mactovish)\
**Post date:** [February 15, 2024, 4:58pm UTC](https://mediasoup.discourse.group/t/media-track-received-in-consumer-but-unable-to-play/5846/8 "2024-02-15T16:58:48Z")

</div>

yes… it gets the producer id from the server…
