简体   繁体   English

在我的游戏网站上为 2 个客户添加视频聊天的最简单方法?

[英]Easiest method of adding video chat for 2 clients on my game website?

I currently am making an online chess site where you can play online chess!我目前正在制作一个在线国际象棋网站,您可以在其中玩在线国际象棋!

While I have the board setup to be multiplayer using socket.io and nodejs, I do not know how to go about adding a video chat function to the site.虽然我使用 socket.io 和 nodejs 将板设置为多人游戏,但我不知道如何 go 向该站点添加视频聊天 function。

Right now, the way I have it set up is that upon loading the site, the user can enter a code to join a chess room.现在,我设置它的方式是在加载站点时,用户可以输入代码以加入棋牌室。

How can I add a video chat that connects both clients to these rooms?如何添加将两个客户连接到这些房间的视频聊天?

If you have any code for this project, please do share it.如果您有此项目的任何代码,请分享。 It's hard to provide an answer for nothing at all.很难无缘无故地给出答案。

If you have no code, consider checking out some of these resources I've found-如果您没有代码,请考虑查看我发现的一些资源 -

  1. https://www.digitalocean.com/community/tutorials/front-and-rear-camera-access-with-javascripts-getusermedia https://www.digitalocean.com/community/tutorials/front-and-rear-camera-access-with-javascripts-getusermedia

(This next one comes with a demo!) (下一个带有演示!)

  1. https://davidwalsh.name/browser-camera https://davidwalsh.name/browser-camera

  2. https://developers.google.com/web/fundamentals/media/capturing-images https://developers.google.com/web/fundamentals/media/capturing-images

Things To Note About Camera Use In The Web:在 Web 中使用相机的注意事项:

Direct access to the camera is a powerful feature.直接访问相机是一项强大的功能。 It requires consent from the user, and your site MUST be on a secure origin (HTTPS).它需要用户的同意,并且您的站点必须位于安全源 (HTTPS) 上。

Hope this helped!希望这有帮助!

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

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