javascript 如何在 Gmail 等网站上进行视频聊天?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/5923254/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-25 18:47:56  来源:igfitidea点击:

How can I have a video chat on my site like Gmail?

phpjavascriptvideovideo-streaming

提问by John Doe

I'm looking for a free opensource project or just some code I can use to have video chatting capabilities on my site. Anyone know if this can be done easily, I know a lot about PHP and jquery.

我正在寻找一个免费的开源项目,或者只是一些我可以用来在我的网站上拥有视频聊天功能的代码。任何人都知道这是否可以轻松完成,我对 PHP 和 jquery 了解很多。

回答by Lukas Knuth

I don't think this can be done with PHP because the application which gets your Webcam's videostream must run on the Client, not on the Server. In this case, if you don't want your users to install special Software on their machines, you'll want to do it with Flash or a Java Applet.

我认为这不能用 PHP 完成,因为获取网络摄像头视频流的应用程序必须在客户端上运行,而不是在服务器上运行。在这种情况下,如果您不希望您的用户在他们的机器上安装特殊软件,您将需要使用 Flash 或 Java Applet 来安装。

I also found a library which uses AJAX and RESTto do it.

我还找到了一个使用 AJAX 和 REST来完成它的库。

回答by Matt

Native browser support enabled via Javascript APIs is under development and supported by Google, Mozilla, and Opera. The project is called WebRTC(Web Real-Time Communications) and is supported in Chrome.

通过 Javascript API 启用的本机浏览器支持正在开发中,并得到 Google、Mozilla 和 Opera 的支持。该项目称为WebRTC(Web 实时通信),并在 Chrome 中受支持。