Package Exports
- getusermedia-async
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (getusermedia-async) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Asynchronous, browser-independent wrapper for the getUserMedia function.
Short sample
var getUserMedia = require('getusermedia-async').getUserMedia;
var audioStreamPromise = getUserMedia({ video: false, audio: true});
// OR:
var audioStream = await getUserMedia({ video: false, audio: true});What's it for?
This is a promise-based, awaitable, browser-independent getUserMedia function to get user's audio or video.
It is based on the getusermedia package by Henrik Joreteg which actually does most of the job.
Methods
getUserMedia(options): returns a stream, or throws aNavigatorUserMediaError.optionsinclude two boolean properties:audio(default:true) andvideo(default:true).getUserAudio(): shortcut togetUserMedia({ audio: true, video: false }).
Example:
var getUserAudio = require('getusermedia-async').getUserAudio;
var audioStreamPromise = getUserAudio();Comments and suggestions
If you have any comments, contact me here: https://github.com/catcher-in-the-try/