# stop-media-stream

> Stops all tracks in a MediaStream

Latest version **1.0.0** (published 2019-11-05) · MIT license · 0 weekly downloads

## Install

```sh
npm install stop-media-stream
pnpm add stop-media-stream
yarn add stop-media-stream
bun add stop-media-stream
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2019-11-05 |
| First published | 2016-08-01 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 3.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 12 |
| Author | Benjamim Sonntag |
| Maintainers | bsonntag |
| Keywords | mediastream, webrtc |

## Links

- npm: https://www.npmjs.com/package/stop-media-stream
- Repository: https://github.com/bsonntag/stop-media-stream
- Homepage: https://github.com/bsonntag/stop-media-stream#readme
- Issues: https://github.com/bsonntag/stop-media-stream/issues
- npm.io page: https://npm.io/package/stop-media-stream

## Alternatives

- [byte-size](https://npm.io/package/byte-size.md) — 2.1M weekly downloads
- [speed-limiter](https://npm.io/package/speed-limiter.md) — 16.0K weekly downloads
- [@powersync/node](https://npm.io/package/@powersync/node.md) — 10.9K weekly downloads
- [@ledgerhq/coin-cardano](https://npm.io/package/@ledgerhq/coin-cardano.md) — 1.0K weekly downloads
- [@jayesol/jayeson.lib.streamfinder](https://npm.io/package/@jayesol/jayeson.lib.streamfinder.md) — 1.0K weekly downloads

## Recent versions

- 1.0.0 (latest) — 2019-11-05
- 0.0.2 — 2018-01-07
- 0.0.1 — 2017-01-06
- 0.0.0 — 2016-08-01

## README

# stop-media-stream

[![npm](https://img.shields.io/npm/v/stop-media-stream.svg)](https://www.npmjs.com/package/stop-media-stream)
[![build status](https://img.shields.io/circleci/project/github/bsonntag/stop-media-stream/master.svg)](https://circleci.com/gh/bsonntag/stop-media-stream)
[![downloads](https://img.shields.io/npm/dt/stop-media-stream.svg)](https://www.npmjs.com/package/stop-media-stream)

Stops and removes all tracks in a MediaStream.

This will release the camera, if the MediaStream was obtained with
[getUserMedia](https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getUserMedia).

## Installation

Install with:

```sh
$ npm install stop-media-stream
```

Or:

```sh
$ yarn add stop-media-stream
```

## Usage

```js
import stopMediaStream from 'stop-media-stream';

// get a media stream somehow
navigator.mediaDevices.getUserMedia(constraints)
  .then(mediaStream => {
    // Use your media stream and when you're done with it:
    stopMediaStream(mediaStream);
  });
```

## Contributing

Please feel free to submit any issues or pull requests.

## License

MIT

---
_Source: https://npm.io/package/stop-media-stream · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
