简体   繁体   English

webRTC HTML5白板/视频聊天

[英]webRTC HTML5 whiteboard/video chat

I'm exploring the options for building a bleeding edge whiteboard application (much like Big Blue Button or Wimba) using webRTC, HTML5, socket.io and node.js. 我正在探索使用webRTC,HTML5,socket.io和node.js构建前沿白板应用程序(很像Big Blue Button或Wimba)的选项。 This would be for one-on-one communication ... no more than two users communicating with each other at a time. 这将是一对一的通信......一次只能有两个用户相互通信。

I'd like use data channels to pass whiteboard data between clients, then have some sort of listener on the server end that can record the video/audio/whiteboard actions. 我想使用数据通道在客户端之间传递白板数据,然后在服务器端有一些可以记录视频/音频/白板操作的监听器。 The server listeners would in effect be wire-tapping the whiteboard/audio/video chat. 服务器监听器实际上是点击白板/音频/视频聊天。 In other words, if the server to client connection gets laggy, it would not affect the quality of the P2P (client-to-client) webRTC connection. 换句话说,如果服务器到客户端连接变得滞后,则不会影响P2P(客户端到客户端)webRTC连接的质量。 This way the server can record the whiteboard interactions at a lower priority leaving the one-on-one chat interactions as high speed as possible. 这样,服务器可以以较低优先级记录白板交互,从而使一对一聊天交互尽可能高速。

Are there any libraries or javascript frameworks that would work well for a shared whiteboard that I should know about? 是否有任何库或javascript框架可以很好地用于我应该了解的共享白板?

Disclaimer: this answer is outdated, see this answer on how something like this can be accomplished. 免责声明:这个答案已经过时,请参阅这个答案 ,了解如何完成这样的事情。


WebRTC is still very new, support is also still a bit shaky. WebRTC还是很新的,支持也有点摇摇欲坠。 Needless to say no libraries or frameworks that do this sort of thing for you exist. 不用说,没有为你做这种事情的库或框架存在。

What you probably want to do is use WebSockets (with socket.io which you are already using) to send some of the data from the client to the server, and simultaneously send the data over WebRTC. 你可能想要做的是使用WebSockets(你已经使用的socket.io)将一些数据从客户端发送到服务器,同时通过WebRTC发送数据。

You can check how fast the connection is (by a sample upload and a sample download) and decide which strategy you want to use: 您可以检查连接的速度 (通过示例上载和示例下载)并确定要使用的策略:

  1. Use WebRTC and record nothing, or record only on the client side and upload to the server when done 使用WebRTC并不记录任何内容,或仅在客户端进行记录,并在完成后上传到服务器
  2. Use both WebRTC and WebSockets , only use WebSockets to transfer 'some' data to the server where 'some' depends on what the connection can hold. 使用WebRTC和WebSockets,只使用WebSockets将“某些”数据传输到服务器,其中“some”取决于连接可以容纳的内容。
  3. Use only WebSockets and transfer all the data to the server, with no P2P involved. 仅使用WebSockets并将所有数据传输到服务器,不涉及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. 这也很大程度上取决于白板的实现,如果你只是为了在板上绘制的内容传递矢量数据,即使AJAX可以处理负载,但是,如果你传递实时视频,我认为只有WebRTC会有效处理负载。

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. 我希望我能在几个月内编辑这个答案,其中包含一长串库和框架,可以让您轻松完成此操作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM