Where I can find RTCMediaStream_<some_id> or streamIdentifier for consumer

I’m trying to integrate watchRTC for monitoring all the streams. What I want to achieve is to map SSRC to peer name so it will be easy to read. for this I want RTCMediaStream_<some_id> (for example RTCMediaStream_oUx4qq5T0xvng4vr9XISNwZnGv0cIl0xSGxJ). Please see the image below What I’m searching for.

Here is the doc URL, in case required Mapping streams in watchRTC • testRTC
Thank you in Advance

WebRTC works with MediaStreamTracks nowadays. You can (and probably want, as audio/video elements still require MediaStream) create a new stream and add some tracks to it. The stream will have a unique id.

@snnz already tried the way you mentioned above. but I doesn’t working with that id. any other work around to get RTCMediaStream_ or streamIdentifier ?
it can be found in chrome://webrtc-internals/ you can see the screenshot below. But I can’t find it in MediaStream.addTrack

You can get that from options.rtpParameters.rtcp.cname, where options is ConsumerOptions that are passed to the client’s transport.consume.

@snnz Thank you very much. it worked for me. Now I’m looking for producer’s RTCMediaStream_someId which seems to be 36 characters. I can find it insde

const publishStats = awaitt transport.getStats();
          const obj = Object.fromEntries(publishStats);

which is different from options.rtpParameters.rtcp.cname

I’m afraid, you’ll have to hack all device handlers of the mediasoup-client in order to get this id. It comes from the local SDP offer, that the handlers parse, but never give out this particular id to the calling functions.