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.
trackEvent = new RTCTrackEvent(eventInfo);
eventInfo
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.streams
Optional
MediaStream
objects representing each of the streams that comprise the event's corresponding track.track
MediaStreamTrack
the event is associated with.transceiver
RTCRtpTransceiver
associated with the event.A new RTCTrackEvent
describing a track which has been added to the RTCPeerConnection
.
Specification | Status | Comment |
---|---|---|
WebRTC 1.0: Real-time Communication Between Browsers The definition of 'RTCTrackEvent()' in that specification. | Candidate Recommendation | Initial specification. |
No compatibility data found. Please contribute data for "api.RTCTrackEvent.RTCTrackEvent" (depth: 1) to the MDN compatibility data repository.
© 2005–2018 Mozilla Developer Network and individual contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/RTCTrackEvent/RTCTrackEvent