Support & information center

Mapping streams in watchRTC

Media channels in watchRTC are labeled based on the names assigned to them by WebRTC, which usually revolves around the SSRC of the streams.

In group sessions this can make figuring out which incoming channel comes from which participant in the session quite time consuming. To make this simpler, you can use watchRTC.mapStream() API in the SDK to let watchRTC know what display name to use for the incoming streams:

watchRTC.mapStream(id, name);
Code language: JavaScript (javascript)

Where id is the RTCMediaStream with the streamIdentifier we wish to map and the name is the display name to associate with it.

Using this will cause the incoming channels on that media stream to show the display name instead of the stream identifier, making it easier to associate the incoming media with its original sender.

For example, if you want to map RTCMediaStream_oUx4qq5T0xvng4vr9XISNwZnGv0cIl0xSGxJ-streamIdentifier to the display name “John Doe”, then we would use:

watchRTC.mapStream("oUx4qq5T0xvng4vr9XISNwZnGv0cIl0xSGxJ", "John Doe");
Code language: JavaScript (javascript)

Was this article helpful?

Related Articles