Media channels in watchRTC are labeled based on the names assigned to them by WebRTC, which usually revolves around the SSRC of the streams.
watchRTC.mapTrack(id,name);
Where id is the RTCMediaStreamTrack with the trackIdentifier we wish to map, and name is the display name to associate with it.
watchRTC.mapTrack("oUx4qq5T0xvng4vr9XISNwZnGv0cIl0xSGxJ", "John Doe");
Inbound vs Outbound Tracks
The watchRTC.mapTrack() API can be used for both incoming and outgoing tracks. It can be used in the following scenarios;
- When you create new outgoing tracks (tracks to be sent)
- When you receive new incoming tracks (when tracks are received front the other side)
- When you call the ‘replace Track’ function (when you want to change the ID of one track to another)
When any of these things are being done you will need to call the watchRTC.mapTrack() API to notify the SDK of the associated track identifier and the new name you wish to be displayed in its place.