Fixing Firefox compatibility by remove references to InputDeviceInfo

This commit is contained in:
David Négrier 2020-06-25 09:28:00 +02:00
parent a52b1f612b
commit 371b4f0063

View File

@ -29,8 +29,8 @@ export class EnableCameraScene extends Phaser.Scene {
private arrowRight: Image; private arrowRight: Image;
private arrowDown: Image; private arrowDown: Image;
private arrowUp: Image; private arrowUp: Image;
private microphonesList: InputDeviceInfo[] = new Array<InputDeviceInfo>(); private microphonesList: MediaDeviceInfo[] = new Array<MediaDeviceInfo>();
private camerasList: InputDeviceInfo[] = new Array<InputDeviceInfo>(); private camerasList: MediaDeviceInfo[] = new Array<MediaDeviceInfo>();
private cameraSelected: number = 0; private cameraSelected: number = 0;
private microphoneSelected: number = 0; private microphoneSelected: number = 0;
private soundMeter: SoundMeter; private soundMeter: SoundMeter;
@ -311,14 +311,12 @@ export class EnableCameraScene extends Phaser.Scene {
private async getDevices() { private async getDevices() {
const mediaDeviceInfos = await navigator.mediaDevices.enumerateDevices(); const mediaDeviceInfos = await navigator.mediaDevices.enumerateDevices();
for (const mediaDeviceInfo of mediaDeviceInfos) { for (const mediaDeviceInfo of mediaDeviceInfos) {
if (mediaDeviceInfo instanceof InputDeviceInfo) {
if (mediaDeviceInfo.kind === 'audioinput') { if (mediaDeviceInfo.kind === 'audioinput') {
this.microphonesList.push(mediaDeviceInfo); this.microphonesList.push(mediaDeviceInfo);
} else if (mediaDeviceInfo.kind === 'videoinput') { } else if (mediaDeviceInfo.kind === 'videoinput') {
this.camerasList.push(mediaDeviceInfo); this.camerasList.push(mediaDeviceInfo);
} }
} }
}
this.updateWebCamName(); this.updateWebCamName();
} }