In short, the
MediaStreamTrack.stop() method stops the track.
stop() tells the user agent that the track's source—whatever that source may be, including files, network streams, or a local camera or microphone—is no longer needed by the
MediaStreamTrack. Since multiple tracks may use the same source (for example, if two tabs are using the device's microphone), the source itself isn't necessarily immediately stopped. It is instead disassociated from the track and the track object is stopped. Once no media tracks are using the source, the source may actually be completely stopped.
Immediately after calling
track state is set to
|Media Capture and Streams
The definition of 'MediaStreamTrack.stop()' in that specification.
|Editor's Draft||Initial specification.|
|Feature||Chrome||Edge||Firefox (Gecko)||Internet Explorer||Opera||Safari|
|Basic support||(Yes)||(Yes)||34 (34)||No support||(Yes)||?|
|Feature||Android||Android Webview||Edge||Firefox Mobile (Gecko)||IE Mobile||Opera Mobile||Safari Mobile||Chrome for Android|
|Basic support||?||(Yes)||(Yes)||34.0 (34)||No support||?||?||(Yes)|
 Prior to Firefox 52, only local tracks (that is, tracks obtained through
getUserMedia()) could be stopped. Now all kinds of tracks can be stopped, including those on a
MediaStream associated with a WebRTC connection, Web Audio API stream, or