Uniquely Identifying Data Channels
Data channels can be opened asymmetrically or symmetrically. For setting video filters remotely, data channels are opened asymmetrically: the peer wishing to set a new video filter adds the channel to the call, and the receiving peer listens for the ondatachannel event. We labeled the data channel by passing in the name of a filter, like filter-grayscale, to the peer connection’s createDataChannel() method.
Useful as they are, labels do not uniquely identify data channels. It’s the stuff of debugging nightmares that multiple data channels can end up with the same label. You can experiment with this by writing a little diagnostic code and joining a call in two browser windows. First, open up an else statement ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access