Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

enumerate-devices

xdumaine111.5kMIT1.1.1

A small project to normalize browser differences for enumerating media devices

webrtc, getUserMedia, getMediaDevices, getSources, enumerateDevices, MediaStreamTrack

readme

What

This is a simple module for normalizing the differences in enumerating media devices in webkit (Chrome/Opera) and Mozilla (Firefox).

Why

Because the usages and results of the two implementations differ, and it's nice to normalize the behavior and results.

How

//promises!
const enumerateDevices = require('enumerate-devices');

enumerateDevices().then((devices) => console.log(devices)).catch(console.log.bind(console));

//or callbacks!

var enumerateDevices = require('enumerate-devices');

enumerateDevices(function(err, devices) {
    if(err) {
        console.log(err.message); //device enumeration not supported
    } else {
        console.log(devices);
    }
});

Test by running npm start and visiting http://localhost:8880/test

Demo

View a demo of the module in use on the test page.

Who

@xanderdumaine