Skip to main content

stopMediaStream

function stopMediaStream(stream, onStopped?): void;

Stops all tracks in the given stream

Immediately after calling stop(), the readyState property is set to ended. Note that the ended event will not be fired in this situation https://developer.mozilla.org/en-US/docs/Web/API/MediaStreamTrack/stop#description

Parameters

ParameterTypeDescription
streamundefined | MediaStreamMediaStream which we mutate
onStopped?(track) => voidcallback to be called when the track is stopped

Returns

void