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
19 changes: 15 additions & 4 deletions app/components-react/windows/settings/VirtualWebcam.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,19 @@ export function VirtualWebcamSettings() {
? $t('Output Scene')
: $t('Output Source');

function onSelectType(value: string, label: string) {
v.update((value as unknown) as VCamOutputType, label);
function onSelectType(value: string) {
const type = Number(value) as VCamOutputType;
let name = '';
if (type === VCamOutputType.SceneOutput) {
const scenes = ScenesService.views.scenes;
name = scenes.length ? scenes[0].id : '';
} else if (type === VCamOutputType.SourceOutput) {
const sources = SourcesService.views
.getSources()
.filter(source => source.type !== 'scene' && source.video);
name = sources.length ? sources[0].sourceId : '';
}
v.update(type, name);
}

function onSelectSelection(value: string) {
Expand All @@ -114,8 +125,8 @@ export function VirtualWebcamSettings() {
options={OUTPUT_TYPE_OPTIONS}
value={v.outputType}
defaultValue={OUTPUT_TYPE_OPTIONS[0].value}
onSelect={(val: string, opts) => {
onSelectType(val, opts.labelrender);
onSelect={(val: string) => {
onSelectType(val);
}}
allowClear={false}
style={{ width: '100%' }}
Expand Down
3 changes: 3 additions & 0 deletions app/services/app/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ import { RealmService } from 'services/realm';
import { StreamAvatarService } from 'services/stream-avatar/stream-avatar-service';
import { NavigationService } from 'services/navigation';
import { StreamingService } from 'services/streaming';
import { VirtualWebcamService } from 'services/virtual-webcam';

interface IAppState {
loading: boolean;
Expand Down Expand Up @@ -102,6 +103,7 @@ export class AppService extends StatefulService<IAppState> {
@Inject() private streamAvatarService: StreamAvatarService;
@Inject() private navigationService: NavigationService;
@Inject() private streamingService: StreamingService;
@Inject() private virtualWebcamService: VirtualWebcamService;

static initialState: IAppState = {
loading: true,
Expand Down Expand Up @@ -221,6 +223,7 @@ export class AppService extends StatefulService<IAppState> {
await this.sceneCollectionsService.deinitialize();
this.performanceService.stop();
this.transitionsService.shutdown();
this.virtualWebcamService.stop();
this.videoSettingsService.shutdown();
await this.gameOverlayService.destroy();
await this.fileManagerService.flushAll();
Expand Down
Loading