两个浏览器之间的音频/视频直播,需要哪些技术?

发布于 2024-12-21 03:55:37 字数 1431 浏览 2 评论 0原文

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

孤檠 2024-12-28 03:55:37

最难的问题是您应该在客户端使用什么来从用户的网络摄像头捕获和流式传输视频。为此,您的选择相对较少,因为您使用的任何内容都必须得到现代浏览器的广泛支持,而您可以在自己的服务器上做任何您想做的事情。

您可以采用三种通用方法:使用 HTML5、使用现有的插件技术或创建您自己的插件。

第三种可能是最难的,我不推荐它。您需要维护至少五个不同版本的插件(每个主要浏览器一个),并且用户必须安装它。

对于第二个选项,现在 ActiveX 已经消亡,存在三种主要的插件技术:Flash、Silverlight 和 Java applet。我建议您远离 Silverlight,因为它不太便携。

这样您就可以选择 Flash、小程序和 HTML5。其中,Flash 是使用最广泛的,但它也有其缺点,并且世界正在逐渐远离它。 HTML5 是未来的潮流,虽然该标准要到 2014 年才会完成,但预计不会改变(最后一次调用是在 2011 年 5 月),并且主要浏览器已经支持其中的大部分内容 - 尽管显然还没有 WebRTC API ,不过我确信它很快就会出现在 Firefox 和 Chrome 中。

The hardest question is what you should use on the client side to capture and stream video from the user's webcam. For that, you have relatively few options, since whatever you use has to be widely supported by modern browsers, whereas you can do whatever you want on your own servers.

There are three general approaches you can take: use HTML5, use an existing plugin technology, or create your own plugin.

The third is probably the most difficult, and I don't recommend it. You'd need to maintain at least five different versions of your plugin (one for each major browser), and users would have to install it.

For the second option, there are three major plugin techologies now that ActiveX is dead: Flash, Silverlight, and Java applets. I'd advise you away from Silverlight, as it's not exactly portable.

That leaves you with Flash, applets, and HTML5 as your choices. Of these, Flash is the most widely used—but it has its disadvantages and the world is moving away from it. HTML5 is the wave of the future, and although the standard won't be finished until 2014, it's not expected to change (Last Call was in May 2011) and the major browsers already support much of it—though apparently not yet the WebRTC API, though I'm sure it'll be in Firefox and Chrome soon.

枯叶蝶 2024-12-28 03:55:37

您是否正在尝试构建类似于 Chatroulette 的东西?它们支持双向视频流和麦克风。他们使用 Flash Player 10 的点对点功能和 Wowza Media Server 来支持他们的网站。

Are you trying to build something similar to Chatroulette? They support bi-directional video streaming and microphones. They use Flash Player 10's peer-to-peer ability and Wowza Media Server to power their site.

戒ㄋ 2024-12-28 03:55:37

不幸的是,我们目前所处的现实答案是 Flash。幸运的是,有 haxe,一个针对 Flash SWF 格式的开源编译器。您可以用它来制作各种东西

链接示例中的服务器是用 haxe(基本上是 AS3)编写的,并编译为 NekoVM(一个 apache 模块)的指令,但如果没有其他的话,它应该提供一个非常好的示例。

Unfortunately, the realistic answer for where we're at today is Flash. Fortunately, there is haxe, an open source compiler for the Flash SWF format. You could use it to make all kinds of stuff.

The server in the linked example is written in haxe (basically AS3) and compiled to instructions for NekoVM (an apache module) but it should provide a pretty good example if nothing else.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文