mirror of https://github.com/OpenVidu/openvidu.git
openvidu-browser: restrict Device.kind string type
parent
fc93566e04
commit
6576f40db8
|
@ -377,8 +377,8 @@ export class OpenVidu {
|
||||||
let videoDevices: Device[] = [];
|
let videoDevices: Device[] = [];
|
||||||
let audioDevices: Device[] = [];
|
let audioDevices: Device[] = [];
|
||||||
pluginAudioDevices = pluginDevices.filter((device: Device) => device.kind === 'audioinput');
|
pluginAudioDevices = pluginDevices.filter((device: Device) => device.kind === 'audioinput');
|
||||||
videoDevices = deviceInfos.filter((device: Device) => device.kind === 'videoinput');
|
videoDevices = deviceInfos.filter((device: MediaDeviceInfo) => device.kind === 'videoinput') as any;
|
||||||
audioDevices = deviceInfos.filter((device: Device) => device.kind === 'audioinput');
|
audioDevices = deviceInfos.filter((device: MediaDeviceInfo) => device.kind === 'audioinput') as any;
|
||||||
videoDevices.forEach((deviceInfo, index) => {
|
videoDevices.forEach((deviceInfo, index) => {
|
||||||
if (!deviceInfo.label) {
|
if (!deviceInfo.label) {
|
||||||
let label = '';
|
let label = '';
|
||||||
|
|
|
@ -20,9 +20,9 @@
|
||||||
*/
|
*/
|
||||||
export interface Device {
|
export interface Device {
|
||||||
/**
|
/**
|
||||||
* `"videoinput"`, `"audioinput"`
|
* The kind of device
|
||||||
*/
|
*/
|
||||||
kind: string;
|
kind: 'videoinput' | 'audioinput';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Unique ID for the device. Use it on `audioSource` or `videoSource` properties of [[PublisherProperties]]
|
* Unique ID for the device. Use it on `audioSource` or `videoSource` properties of [[PublisherProperties]]
|
||||||
|
|
Loading…
Reference in New Issue