AudioStreamTrack, VideoStreamTrack and LocalMediaStream have been removed

Published: | Categories: Audio & Video, DOM

Description

The AudioStreamTrack and VideoStreamTrack interfaces, subclasses of MediaStreamTrack, have been removed with Firefox 64. Firefox was the only browser supporting these legacy interfaces removed from the Media Capture and Streams spec back in 2014. If necessary, the type of a MediaStreamTrack object can be detected using the kind property.

The LocalMediaStream interface has also been removed. The getUserMedia method now returns a MediaStream object instead of LocalMediaStream, which was implemented only in Firefox. Its stop method deprecated since Firefox 44 can be replaced with the stop method on the MediaStreamTrack interface, as shown below:

navigator.mediaDevices.getUserMedia({
  audio: false,
  video: true
}).then(stream => {
  // Instead of stream.stop(), do this:
  stream.getVideoTracks()[0].stop();
});

References