如何使用 webRTC、node.js 和 socket.io 构建多用户视频聊天 Web 应用程序 [英] how to build multi-user video chatting web app using webRTC, node.js and socket.io

查看:42
本文介绍了如何使用 webRTC、node.js 和 socket.io 构建多用户视频聊天 Web 应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试制作一个支持多用户视频聊天的网络应用程序.我读过一篇关于 webrtc 的文章webrtc 入门"(http://www.html5rocks.com/en/tutorials/webrtc/basics/) 并在 codelab 上做了一些演示.但我仍然不知道如何使它成为一个 3 路电话会议.我对 node.js 和 socket.io 不太了解.刚开始学习它们,因为我正在尝试构建这个视频网络应用.

im trying to make a web app that supports multi-user video chatting. ive read an article about webrtc on "getting started with webrtc" (http://www.html5rocks.com/en/tutorials/webrtc/basics/) and done some demo on codelab. but i still dont really know how to make it a 3-way conferencing call.i dont really know a lot about node.js and socket.io. just started learning them because im trying to build this video web app.

所以我的问题是 webrtc 或 socket.io 的哪个部分决定了 2 个以上的用户可以加入通话?或者你们让我直接访问的任何资源?

so my question is which part of webrtc or socket.io determines that more than 2 users can join the call? or any resource that you guys get direct me to?

提前致谢.

推荐答案

我想说这里有两个独立的事情.WebRTC 需要信令来设置两个节点之间的点对点通信.我认为您在为此使用 Node.js 和 Socket.js 时走在正确的轨道上.

I would say that there are two separate things here. WebRTC needs signaling to setup the peer-to-peer communication between two nodes. I think you are on the right track when using Node.js and Socket.js for this.

但是,决定第三方是否可以加入会议的不是 WebRTC(或 socket.io),而是您自己决定的.这是信令的另一部分,与 WebRTC 关系不大.

But it is not WebRTC (or socket.io) that decides if a third part can join the meeting, it is you that decides this. And this is the other part of the signaling that have little to do with WebRTC.

这意味着您实现了设置会议室、发现可用会议室、加入会议室等功能.当三部分​​会议启动并运行时,每个节点将有两个对等连接,一个连接到每个其他节点.

This meens that you implement functionality like setting up meetingroom, discover available meetingrooms, joining meetingrooms etc. When the three part meeting is up and running, each node will have two peer connections, one to each of the other nodes.

这篇关于如何使用 webRTC、node.js 和 socket.io 构建多用户视频聊天 Web 应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆