@fakes/media-devices
Version:
A interactive fake implementation of MediaDevices interface in the browser for testing
19 lines (18 loc) • 561 B
JavaScript
export const anyDevice = (override = {}) => {
return {
deviceId: 'stand-in-device-id',
groupId: 'stand-in-group-id',
kind: 'videoinput',
label: 'Acme Device (HD)',
...override,
};
};
export const anyCamera = (override = {}) => {
return anyDevice({ ...override, kind: 'videoinput' });
};
export const anyMicrophone = (override = {}) => {
return anyDevice({ ...override, kind: 'audioinput' });
};
export const anySpeaker = (override = {}) => {
return anyDevice({ ...override, kind: 'audiooutput' });
};