gumadapter
v1.0.1
Published
getUserMedia shim/polyfill via: https://github.com/webrtc/adapter
Downloads
12
Maintainers
Readme
getUserMedia Adatper
Copyrights goes to:
- https://github.com/webrtc/adapter/blob/master/LICENSE.md
navigator.getUserMedi
is upgraded into promises based API:navigator.mediaDevices.getUserMedia
.This shim/polyfill merely helps handling cross-browser issues.
Check all releases:
- https://github.com/muaz-khan/gumadapter/releases
How to link?
<script src="https://cdn.WebRTC-Experiment.com/gumadapter.js"></script>
It is suggested to link specific release:
- https://github.com/muaz-khan/gumadapter/releases
E.g.
<!-- use 5.2.4 or any other version -->
<script src="https://github.com/muaz-khan/gumadapter/releases/download/1.0.1/gumadapter.js"></script>
How to use?
function successCallback(stream) {
video.srcObject = stream;
}
function errorCallback(error) {
// maybe another application is using the device
}
var mediaConstraints = { video: true, audio: true };
navigator.mediaDevices.getUserMedia(mediaConstraints).then(successCallback).catch(errorCallback);