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
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);
}
)
👤 Jaikanth J
- Github: @jaikanthjay46
Copyright © 2020 Jaikanth J.
This project is ISC licensed.
This README was generated with ❤️ by readme-md-generator