win10-find-all-video-capture-devices
v0.2.0
Published
Find all video capture devices on Windows 10.
Downloads
4
Maintainers
Readme
win10-find-all-video-capture-devices
Find all video capture devices on Windows 10.
This module is a wrapper around the DeviceInformation.findAllAsync method from the Windows.Devices.Enumeration namespace of the Universal Windows Platform API.
Thanks to NodeRT, this module comes prebuilt for Windows 10.
Installation
npm install win10-find-all-video-capture-devices
Quickstart
const isWin10 = require('is-win10')
const findAllVideoCaptureDevices = require('win10-find-all-video-capture-devices')
if (isWin10) {
findAllVideoCaptureDevices().then(devices => {
devices.forEach(device => {
console.log(device)
/* {
* enclosureLocation: {
* inDock: false,
* inLid: true,
* panel: 'front',
* rotationAngleInDegreesClockwise: 0
* },
* id: '{{id}}',
* isDefault: false,
* isEnabled: true,
* kind: 'deviceInterface',
* name: '{{name}}',
* pairing: {
* canPair: false,
* isPaired: false,
* protectionLevel: 'none'
* }
* }
*/
})
})
}
API
findAllVideoCaptureDevices()
- returns a
<Promise>
which:- resolves with an
<Array>
of video capture devices - rejects with an
<Error>
- if used on a non-Windows 10 system
- if finding the devices failed
- resolves with an
For more documentation, check out the code comments, or consult the official UWP Windows.Devices.Enumeration documentation.
License
WTFPL – Do What the F*ck You Want to Public License.
Made with :heart: by @MarkTiedemann.