diff --git a/.vscode/settings.json b/.vscode/settings.json index 00508d6..6744008 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -3,8 +3,8 @@ "editor.formatOnSave": true, "editor.defaultFormatter": "esbenp.prettier-vscode", "editor.codeActionsOnSave": { - "source.fixAll": true, - "source.addMissingImports": true + "source.fixAll": "explicit", + "source.addMissingImports": "explicit" }, "prettier.enable": true, "cSpell.enabled": true, diff --git a/package.json b/package.json index f0bed45..91bc540 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@agoraio-extensions/agora-rtc-sdk-ng-fake", - "version": "1.0.12", + "version": "1.0.13", "private": true, "description": "Fake Agora Web RTC for testing", "repository": { diff --git a/src/index.ts b/src/index.ts index d5e4729..fc7ddd5 100644 --- a/src/index.ts +++ b/src/index.ts @@ -15,6 +15,8 @@ export * from "./client"; export * from "./version"; export const FAKE_VIDEOINPUT_DEVICE_ID = "1"; +export const FAKE_PLAYBACKINPUT_DEVICE_ID = "2"; +export const FAKE_RECORDINGINPUT_DEVICE_ID = "3"; const FakeAgoraRTC = createFakeAgoraRTC({ setAppType(): void { @@ -33,32 +35,48 @@ const FakeAgoraRTC = createFakeAgoraRTC({ // }, getCameras(): Promise { - //todo return Promise.resolve([ { kind: "videoinput", - deviceId: "1", - label: "1", + deviceId: FAKE_VIDEOINPUT_DEVICE_ID, + label: FAKE_VIDEOINPUT_DEVICE_ID, + }, + ] as MediaDeviceInfo[]); + }, + getMicrophones(): Promise { + return Promise.resolve([ + { + kind: "audioinput", + deviceId: FAKE_RECORDINGINPUT_DEVICE_ID, + label: FAKE_RECORDINGINPUT_DEVICE_ID, + }, + ] as MediaDeviceInfo[]); + }, + getPlaybackDevices(): Promise { + return Promise.resolve([ + { + kind: "audiooutput", + deviceId: FAKE_PLAYBACKINPUT_DEVICE_ID, + label: FAKE_PLAYBACKINPUT_DEVICE_ID, }, ] as MediaDeviceInfo[]); }, getDevices(): Promise { - //todo return Promise.resolve([ { kind: "videoinput", deviceId: FAKE_VIDEOINPUT_DEVICE_ID, - label: "1", + label: FAKE_VIDEOINPUT_DEVICE_ID, }, { kind: "audiooutput", - deviceId: "2", - label: "2", + deviceId: FAKE_PLAYBACKINPUT_DEVICE_ID, + label: FAKE_PLAYBACKINPUT_DEVICE_ID, }, { kind: "audioinput", - deviceId: "3", - label: "3", + deviceId: FAKE_RECORDINGINPUT_DEVICE_ID, + label: FAKE_RECORDINGINPUT_DEVICE_ID, }, ] as MediaDeviceInfo[]); },