Skip to content

This is for the smooth interim transition of getUserMedia being moved it to mediaDevices. Also gives the old callback style API.

License

Notifications You must be signed in to change notification settings

jaikanthjay46/webcam-shim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

webcam-shim 👋

Version Maintenance License: ISC

This is for the smooth interim transition of getUserMedia being moved it to mediaDevices. Also gives the old callback style API. This package can be used as standalone and in frameworks such as Angular

Usage

npm i webcam-shim
import { getUserMedia } from 'webcam-shim/lib';

...


const constraints: MediaStreamConstraints = { audio: false, video: {  facingMode: 'user' }}
getUserMedia(constraints, 
  (stream) => {
    document.querySelector('#video').video.srcObject = stream;
  },
  (err) => {
      console.log("The following error occurred: " + err);
  }
)

Author

👤 Jaikanth J

📝 License

Copyright © 2020 Jaikanth J.
This project is ISC licensed.

This README was generated with ❤️ by readme-md-generator

About

This is for the smooth interim transition of getUserMedia being moved it to mediaDevices. Also gives the old callback style API.

Resources

License

Stars

Watchers

Forks

Packages

No packages published