Instantiating MediaDeviceInfo results in 'Illegal constructor'

218 Views Asked by At

Is it possible to instantiate my own instance of MediaDeviceInfo? Both of these fail:

new MediaDeviceInfo();

new MediaDeviceInfo({
  deviceId: 'Brad Test',
  groupId: 'Brad Test',
  kind: 'audioinput',
  label: 'Brad Test'
});

Uncaught TypeError: Illegal constructor

1

There are 1 best solutions below

0
On BEST ANSWER

No, there is no constructor defined on the interface: https://w3c.github.io/mediacapture-main/#device-info