RTCRtpSender - Web APIs 编辑

The RTCRtpSender interface provides the ability to control and obtain details about how a particular MediaStreamTrack is encoded and sent to a remote peer. With it, you can configure the encoding used for the corresponding track, get information about the device's media capabilities, and so forth. You can also obtain access to an RTCDTMFSender which can be used to send DTMF codes (to simulate the user pressing buttons on a telephone's dial pad) to the remote peer.

Properties

RTCRtpSender.dtmf Read only
An RTCDTMFSender which can be used to send DTMF tones using telephone-event payloads on the RTP session represented by the RTCRtpSender object. If null, the track and/or the connection doesn't support DTMF. Only audio tracks can support DTMF.
RTCRtpSender.track Read only
The MediaStreamTrack which is being handled by the RTCRtpSender. If track is null, the RTCRtpSender doesn't transmit anything.
RTCRtpSender.transport Read only
The RTCDtlsTransport over which the sender is exchanging the RTP and RTCP packets used to manage transmission of media and control data. This value is null until the transport is established. When bundling is in use, more than transceiver may be sharing the same transport object.

Obsolete properties

rtcpTransport This is an obsolete API and is no longer guaranteed to work.
This property has been removed; the RTP and RTCP transports have been combined into a single transport. Use the transport property instead.

Methods

RTCRtpSender.getParameters()
Returns a RTCRtpParameters object describing the current configuration for the encoding and transmission of media on the track.
RTCRtpSender.getStats()
Returns a Promise which is fulfilled with a RTCStatsReport which provides statistics data for all outbound streams being sent using this RTCRtpSender.
RTCRtpSender.setParameters()
Applies changes to parameters which configure how the track is encoded and transmitted to the remote peer.
RTCRtpSender.setStreams()
Sets the MediaStream(s) associated with the track being transmitted by this sender.
RTCRtpSender.replaceTrack()
Attempts to replace the track currently being sent by the RTCRtpSender with another track, without performing renegotiation. This method can be used, for example, to toggle between the front- and rear-facing cameras on a device.

Static methods

RTCRtpSender.getCapabilities()
Returns an RTCRtpCapabilities object describing the system's capabilities for sending a specified kind of media data.

Specifications

SpecificationStatusComment
WebRTC 1.0: Real-time Communication Between Browsers
The definition of 'RTCRtpSender' in that specification.
Candidate Recommendation

Browser compatibility

BCD tables only load in the browser

See also

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

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

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据

词条统计

浏览:122 次

字数:7139

最后编辑:7年前

编辑次数:0 次

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