Reputation: 3626
How to completely kill the WebRTC media stream?
MediaStream.stop()
is not working anymore.
Testing in Chrome 47, Mac OS 10.11.
Upvotes: 17
Views: 19881
Reputation: 42490
Use stream.getTracks().forEach(track => track.stop());
.
stream.stop()
was deprecated.
Upvotes: 47
Reputation: 11
For all browsers
if (microphone_data.media_stream) {
microphone_data.media_stream.getTracks().forEach(function (track) { track.stop(); });
}
Upvotes: 0