这篇翻译不完整。请帮忙从英语翻译这篇文章

这是一个实验中的功能
此功能某些浏览器尚在开发中,请参考浏览器兼容性表格以得到在不同浏览器中适合使用的前缀。由于该功能对应的标准文档可能被重新修订,所以在未来版本的浏览器中该功能的语法和行为可能随之改变。

MediaStream处理API(通常被称为媒体流API或流API)是描述音频或视频数据流的WebRTC的一部分,处理它们的方法,与数据类型相关的约束,成功和错误 当异步使用数据时的回调以及在处理期间触发的事件。

基本概念

这个API是基于操纵一个 MediaStream 对象代表音频或视频相关数据的流量。 通常一个 MediaStream是作为一个简单的URL string 它可以用来引用存储在DOM中的数据 File, 或者一个 Blob 对象建立 window.URL.createObjectURL(), 如视频所描述的

A MediaStream consists of zero or more MediaStreamTrack objects, representing various audio or video tracks. Each MediaStreamTrack may have one or more channels. The channel represents the smallest unit of a media stream, such as an audio signal associated with a given speaker, like left or right in a stereo audio track.

MediaStream objects have a single input and a single output. A MediaStream object generated by getUserMedia() is called local, and has as its source input one of the user's cameras or microphones. A non-local MediaStream may be representing to a media element, like <video> or <audio>, a stream originating over the network, and obtained via the WebRTC PeerConnection API, or a stream created using the Web Audio API MediaStreamAudioSourceNode.   The output of the MediaStream object is linked to a consumer. It can be a media elements, like <audio> or <video>,  the WebRTC PeerConnection API or a Web Audio API MediaStreamAudioDestinationNode.

参考

浏览器支持

We're converting our compatibility data into a machine-readable JSON format. This compatibility table still uses the old format, because we haven't yet converted the data it contains. Find out how you can help!

Feature Chrome Firefox (Gecko) Internet Explorer Opera  Safari (WebKit)
Stream API  21webkit  nightly 18moz  ?  12 ? 
Feature Android Firefox Mobile (Gecko) IE Phone Opera Mobile Safari Mobile
Stream API  未实现  ? ?  未实现  未实现 

Currently using WebRTC for accessing the camera is supported in Chrome, Opera and Firefox Nightly 18. Enabling WebRTC in Firefox Nightly requires you to set a flag in the configuration:

  • Type "about:config" in the address bar and say yes that you want to make changes
  • Find the "media.navigator.enabled" entry and set it to true

See Also

文档标签和贡献者

此页面的贡献者: yzweb2018, w05163
最后编辑者: yzweb2018,