feat: Add webcam basic support
This commit is contained in:
@@ -14,6 +14,7 @@ export class WebRtcStateController {
|
||||
readonly connectedPeers: Signal<string[]>;
|
||||
readonly isMuted: Signal<boolean>;
|
||||
readonly isDeafened: Signal<boolean>;
|
||||
readonly isCameraEnabled: Signal<boolean>;
|
||||
readonly isScreenSharing: Signal<boolean>;
|
||||
readonly isNoiseReductionEnabled: Signal<boolean>;
|
||||
readonly screenStream: Signal<MediaStream | null>;
|
||||
@@ -31,6 +32,7 @@ export class WebRtcStateController {
|
||||
private readonly _connectedPeers = signal<string[]>([]);
|
||||
private readonly _isMuted = signal(false);
|
||||
private readonly _isDeafened = signal(false);
|
||||
private readonly _isCameraEnabled = signal(false);
|
||||
private readonly _isScreenSharing = signal(false);
|
||||
private readonly _isNoiseReductionEnabled = signal(false);
|
||||
private readonly _screenStreamSignal = signal<MediaStream | null>(null);
|
||||
@@ -49,6 +51,7 @@ export class WebRtcStateController {
|
||||
this.connectedPeers = computed(() => this._connectedPeers());
|
||||
this.isMuted = computed(() => this._isMuted());
|
||||
this.isDeafened = computed(() => this._isDeafened());
|
||||
this.isCameraEnabled = computed(() => this._isCameraEnabled());
|
||||
this.isScreenSharing = computed(() => this._isScreenSharing());
|
||||
this.isNoiseReductionEnabled = computed(() => this._isNoiseReductionEnabled());
|
||||
this.screenStream = computed(() => this._screenStreamSignal());
|
||||
@@ -89,6 +92,10 @@ export class WebRtcStateController {
|
||||
return this._isScreenSharing();
|
||||
}
|
||||
|
||||
isCameraEnabledActive(): boolean {
|
||||
return this._isCameraEnabled();
|
||||
}
|
||||
|
||||
setCurrentServer(serverId: string): void {
|
||||
this.activeServerId = serverId;
|
||||
}
|
||||
@@ -105,6 +112,10 @@ export class WebRtcStateController {
|
||||
this._isDeafened.set(deafened);
|
||||
}
|
||||
|
||||
setCameraEnabled(enabled: boolean): void {
|
||||
this._isCameraEnabled.set(enabled);
|
||||
}
|
||||
|
||||
setNoiseReductionEnabled(enabled: boolean): void {
|
||||
this._isNoiseReductionEnabled.set(enabled);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user