Sending Images over the Chat
Let’s return to the chat feature now one last iteration: enabling users to send and receive images.
Text messages will continue to be sent over the symmetric, negotiated chat channel. But in a return to the short-lived data channels you wrote for the video-filter feature in Applying Filters Remotely with Data Channels, each image a user sends will be delivered over its own asymmetric, short-lived data channel.
Your use of multiple data channels will be invisible to users: images will be appended to the chat log just like text messages are already. But by using one data channel per image, we will avoid congestion on the primary text-chat data channel. It would become a lot less performant for sending text messages ...
Get Programming WebRTC now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.