MediaStreamTrackEvent: track property

The track read-only property of the MediaStreamTrackEvent interface returns the MediaStreamTrack associated with this event.

Value

Examples

js
const stream = new MediaStream();

stream.addEventListener("removetrack", (event) => {
  console.log(`${event.track.kind} track removed`);
});

Specifications

Specification
Media Capture and Streams
# dom-mediastreamtrackevent-track

Browser compatibility

BCD tables only load in the browser

See also