如何使用网络浏览器制作 P2P 流媒体?
我想创建一个P2P视频传输的应用程序。更详细地说,我需要以下内容:
- 用户可以通过单击应用程序中的按钮来打开网络摄像头。
- 应用程序开始从网络摄像头拍摄图像并将其发送到特定位置(由端口和 IP 地址指定)。
- 应用程序开始接受另一个应用程序发送的图像并将它们(图像)显示在窗口中。
还有一件事。我更愿意将所有内容都放在浏览器中。我知道一切都可以通过 Adobe 的 Flash Player 完成(例如 http://chatroulette.com/) 。
但我想知道 JavaScript 是否也可以做到这一点。
我确信该应用程序可以用 Java 编写。但是我可以使用 Java 将所有内容都包含在浏览器中吗?
I want to create an application for P2P video transmission. In more details, I need the following:
- User can switch on a web camera by clicking a button in an application.
- Application starts to take images from the web camera and sends them to a certain location (given by a port and IP address).
- Application starts to accept images send by another application and display them (images) in a window.
There is also one more thing. I would prefer to have everything in a browser. I know that everything can be done with Flash Player from Adobe (an example is http://chatroulette.com/).
But I would like to know if the same can be done with JavaScripts.
I am sure it the application can be written in Java. But can I use Java to have everything in a Browser.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我不确定网络摄像头访问是否可以在任何浏览器中本地使用,因此您可能无法使用纯 js 解决方案。我认为很快就会在规范中添加一些内容。
如果您想使用 Flash 来实现这一点(这确实是目前最好的方法),请查看 red5,您可以在服务器上运行它,以坐在客户端之间并处理视频流。
I'm not sure that webcam access is available in any of the browsers natively yet so you might be out of luck for a pure js solution. I think there's meant to be something added to the spec soon though.
If you want to do it with flash (which is really the best way at present) take a look at red5 which you can run on the server to sit between the clients and deal with the video streaming.