*** id: 2bfddd5a-8f22-4066-b69f-230391309cd6 title: stopStream slug: /js/reference/webrtc/stop-stream description: stopStream function in the WebRTC namespace. max-toc-depth: 3 ---------------- ### stopStream * `Const` **stopStream**(`stream?`): `void` Stops all tracks in a specified stream and fires the `ended` event for each. #### Parameters The media stream to stop. See [MediaStream](https://developer.mozilla.org/en-US/docs/Web/API/MediaStream) for more details. #### Returns `void`