webrtc html5,javascript - webRTC HTML5 whiteboard/video chat - Stack Overflow

本文探讨了如何结合使用WebRTC和WebSocket技术来实现实时通信功能,特别是在白板应用场景中。作者建议根据网络连接质量选择不同的数据传输策略,并提出了几种可能的实现方案。

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. 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.

You can check how fast the connection is (by a sample upload and a sample download) and decide which strategy you want to use:

Use WebRTC and record nothing, or record only on the client side and upload to the server when done

Use both WebRTC and WebSockets , only use WebSockets to transfer 'some' data to the server where 'some' depends on what the connection can hold.

Use only WebSockets and transfer all the data to the server, with no P2P involved.

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.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值