免责声明:此答案已过时,请参阅此答案以了解如何完成此类事情。
WebRTC 还很新,支持也有点不稳定。不用说,不存在为您做这种事情的库或框架。
您可能想要做的是使用 WebSockets(您已经在使用 socket.io)将一些数据从客户端发送到服务器,同时通过 WebRTC 发送数据。
您可以检查连接的速度(通过示例上传和示例下载)并决定要使用哪种策略:
- 使用 WebRTC 不记录,或仅在客户端记录并在完成后上传到服务器
- 同时使用 WebRTC 和 WebSockets ,仅使用 WebSockets 将“一些”数据传输到服务器,其中“一些”取决于连接可以容纳的内容。
- 仅使用 WebSocket 并将所有数据传输到服务器,不涉及 P2P。
I think the most viable options are the first and second.
This also greatly depends on the implementation of the White Board, if you're only passing vector data for what was drawn on the board, even AJAX can handle the load, however, if you are passing live video I think nothing but WebRTC will effectively handle the load.
Good luck! This sounds like an interesting idea. I hope I will be able to edit this answer in a few months with a long list of libraries and frameworks that would let you easily do this.