Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export function VoiceInputOptions() {
<CategoryButton.Group>
<SelectInput kind="audioinput" />
<SelectInput kind="audiooutput" />
{/* <SelectInput kind="videoinput" /> TODO O.o */}
<SelectInput kind="videoinput" />
</CategoryButton.Group>
<VolumeSliders />
</Column>
Expand All @@ -37,19 +37,25 @@ function SelectInput(props: { kind: MediaDeviceKind }) {
const media = createMemo(() => useMediaDeviceSelect({ kind: props.kind }));

const setKey = () =>
props.kind === "audioinput"
? "preferredAudioInputDevice"
: "preferredAudioOutputDevice";
props.kind === "videoinput"
? "preferredVideoDevice"
: props.kind === "audioinput"
? "preferredAudioInputDevice"
: "preferredAudioOutputDevice";

const icon = () =>
props.kind === "audioinput" ? (
props.kind === "videoinput" ? (
<Symbol>camera_video</Symbol>
) : props.kind === "audioinput" ? (
<Symbol>mic</Symbol>
) : (
<Symbol>speaker</Symbol>
);

const title = () =>
props.kind === "audioinput" ? (
props.kind === "videoinput" ? (
<Trans>Select video input</Trans>
) : props.kind === "audioinput" ? (
<Trans>Select audio input</Trans>
) : (
<Trans>Select audio output</Trans>
Expand Down
19 changes: 19 additions & 0 deletions packages/client/components/state/stores/Voice.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ export const ScreenShareQualityNames: ScreenShareQualityName[] = [
export interface TypeVoice {
preferredAudioInputDevice?: string;
preferredAudioOutputDevice?: string;
preferredVideoDevice?: string;

echoCancellation: boolean;
noiseSupression: NoiseSuppresionState;
Expand Down Expand Up @@ -99,6 +100,10 @@ export class Voice extends AbstractStore<"voice", TypeVoice> {
data.preferredAudioOutputDevice = input.preferredAudioOutputDevice;
}

if (typeof input.preferredVideoDevice === "string") {
data.preferredVideoDevice = input.preferredVideoDevice;
}

if (typeof input.echoCancellation === "boolean") {
data.echoCancellation = input.echoCancellation;
}
Expand Down Expand Up @@ -216,6 +221,13 @@ export class Voice extends AbstractStore<"voice", TypeVoice> {
this.set("preferredAudioOutputDevice", value);
}

/**
* Set the preferred video input device
*/
set preferredVideoDevice(value: string) {
this.set("preferredVideoDevice", value);
}

/**
* Set echo cancellation
*/
Expand Down Expand Up @@ -293,6 +305,13 @@ export class Voice extends AbstractStore<"voice", TypeVoice> {
return this.get().preferredAudioInputDevice;
}

/**
* Get the preferred video input device
*/
get preferredVideoDevice(): string | undefined {
return this.get().preferredVideoDevice;
}

/**
* Get echo cancellation
*/
Expand Down
Loading