stop-media-stream

1.0.0 • Public • Published

stop-media-stream

npm build status downloads

Stops and removes all tracks in a MediaStream.

This will release the camera, if the MediaStream was obtained with getUserMedia.

Installation

Install with:

$ npm install stop-media-stream

Or:

$ yarn add stop-media-stream

Usage

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

Readme

Keywords

Package Sidebar

Install

npm i stop-media-stream

Weekly Downloads

85

Version

1.0.0

License

MIT

Unpacked Size

3.43 kB

Total Files

4

Last publish

Collaborators

  • bsonntag