RTCTrackEvent() constructor creates and returns a new RTCTrackEvent object, configured to describe the track which has been added to the RTCPeerConnection .

In general, you won't need to use this constructor, as RTCTrackEvent objects are created by WebRTC and delivered to your RTCPeerConnector 's ontrack event handler as appropriate.

句法

trackEvent = new RTCTrackEvent(eventInfo);
					

参数

eventInfo
An object based on the RTCTrackEventInit dictionary, providing information about the track which has been added to the RTCPeerConnection . This object has the following properties:
receiver
RTCRtpReceiver which is being used to receive the track's media.
可选
An array of MediaStream objects representing each of the streams that comprise the event's corresponding track.
track
MediaStreamTrack the event is associated with.
transceiver
RTCRtpTransceiver 与事件关联。

返回值

新的 RTCTrackEvent describing a track which has been added to the RTCPeerConnection .

规范

规范 状态 注释
WebRTC 1.0: Real-time Communication Between Browsers
The definition of 'RTCTrackEvent()' in that specification.
候选推荐 最初的规范。

浏览器兼容性

The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.

No compatibility data found. Please contribute data for "api.RTCTrackEvent.RTCTrackEvent" (depth: 1) to the MDN 兼容性数据存储库 .

元数据

  • 最后修改: