Asynchronous, browser-independent wrapper for the getUserMedia function.
Short sample
var getUserMedia = getUserMedia;var audioStreamPromise = ;// OR:var audioStream = await ;
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
.options
include two boolean properties:audio
(default:true
) andvideo
(default:true
).getUserAudio()
: shortcut togetUserMedia({ audio: true, video: false })
.
Example:
var getUserAudio = getUserAudio;var audioStreamPromise = ;
Comments and suggestions
If you have any comments, contact me here: https://github.com/catcher-in-the-try/