将视频通话和语音通话添加到我的网站 php
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/12782644/
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
Add making video call and voice call to my site php
提问by shamika
I am creating a social network for some crowd.At there I need to add video calling and voice calling functionalities(like facebook or skype) to this site.I need to do this with PHP.Is there any api or help menu for this?
我正在为一些人群创建一个社交网络。在那里我需要向这个站点添加视频通话和语音通话功能(如 facebook 或 Skype)。我需要用 PHP 来做到这一点。是否有任何 api 或帮助菜单?
回答by jimmy
<a href="callto://+2345634563456">Link will initiate Skype call to number</a>
<a href="skype:username?call">Link will initiate Skype call to username</a>
Easy for Skype. Don't know about Facebook.
易于Skype。不知道脸书。
回答by jimcavoli
I'm assuming you mean that you want to run your own private video calls, not simply link to Skype calls or similar. You really have 2 options here: host it yourself, or use a hosted solution and integrate it into your product.
我假设您的意思是您想要运行自己的私人视频通话,而不是简单地链接到 Skype 通话或类似通话。您在这里确实有 2 个选择:自己托管,或者使用托管解决方案并将其集成到您的产品中。
Self-Hosted
自托管
This is messy. This can all be accomplished with PHP, but that is probably not the most advisable solution, as it is not the best tool for the job on all sides. Flash is much more efficient at a/v capture and transport on the user end. You can try to do this without flash, but you will have headaches. HTML5 may make your life easier, but if you're shooting for maximum compatibility, flash is the simplest way to go for creating the client. Then, as far as the actual server side that will relay the audio/video, you could write a chat server in php, but you're better off using an open source project, like janenz00's mention of red5, that's already built and interfacing with it through your client (if it doesn't already have one). Or you could homebrew a flash client as mentioned before and hook it up to a flash streaming server on both sides...either way it gets complicated fast, and is beyond my expertise to help you with at all.
这很乱。这一切都可以用 PHP 来完成,但这可能不是最可取的解决方案,因为它不是所有方面的工作的最佳工具。Flash 在用户端的 a/v 捕获和传输方面效率更高。您可以尝试在没有闪光灯的情况下执行此操作,但是您会头疼。HTML5 可能会让您的生活更轻松,但如果您要获得最大的兼容性,Flash 是创建客户端的最简单方法。然后,至于将中继音频/视频的实际服务器端,您可以在 php 中编写一个聊天服务器,但最好使用开源项目,例如janenz00提到的red5,它已经通过您的客户端构建并与之连接(如果它还没有)。或者你可以自制一个之前提到的 flash 客户端,并将它连接到双方的 flash 流媒体服务器......无论哪种方式都会变得复杂,而且我的专业知识无法帮助你。
Hosted Service
托管服务
All in, my recommendation, unless you want to administer a ridiculous setup of many complex servers and failure points is to use a hosted service like UserPlaneor similar and offload all the processing and technical work to people who are good at that, and then worry about interfacing with their api and getting their client well integrated into your site. You will be a happier developer if you do.
总而言之,我的建议是,除非您想管理许多复杂服务器和故障点的荒谬设置,否则请使用像UserPlane或类似的托管服务,并将所有处理和技术工作卸载给擅长此的人,然后再担心关于与他们的 api 接口并使他们的客户很好地集成到您的网站中。如果你这样做,你会成为一个更快乐的开发者。
回答by janenz00
For a video call to work, you will need:
要进行视频通话,您需要:
- A client program which can detect the webcam and mic from your system and upload (stream) to a server.
- A streaming server, which will capture the uploaded stream and relays it to the other users- red5, Wowza, Fashmedia server etc.
- 一个客户端程序,可以从您的系统中检测网络摄像头和麦克风并上传(流)到服务器。
- 一个流媒体服务器,它将捕获上传的流并将其转发给其他用户——red5、Wowza、Fashmedia 服务器等。
Looks like you are a beginner in this area. If so, try with red5, since it is opensource. They have examples of video calling.
看起来您是该领域的初学者。如果是这样,请尝试使用red5,因为它是开源的。他们有视频通话的例子。

