Stop / kill WebRTC media stream

igorpavlov picture igorpavlov · Jan 23, 2016 · Viewed 12.2k times · Source

How to completely kill the WebRTC media stream?

MediaStream.stop() is not working anymore.

Testing in Chrome 47, Mac OS 10.11.

Answer

jib picture jib · Jan 23, 2016

Use stream.getTracks().forEach(track => track.stop());.

stream.stop() was deprecated.