RTCTrackEvent()

The 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.

Syntax

trackEvent = new RTCTrackEvent(eventInfo);

Parameters

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: {{page("/en-US/docs/Web/API/RTCTrackEventInit", "property-list")}}

Return value

A new RTCTrackEvent describing a track which has been added to the RTCPeerConnection.

Specifications

Specification
WebRTC 1.0: Real-Time Communication Between Browsers (WebRTC 1.0)
# dom-rtctrackevent-constructor

Browser compatibility

BCD tables only load in the browser