Add crop to fit toggle to context menu. (#2107)

Signed-off-by: Timo K <toger5@hotmail.de>
This commit is contained in:
Timo
2024-02-12 16:49:32 +01:00
committed by GitHub
parent 242d2dc2bc
commit bcd8890f0a
4 changed files with 38 additions and 1 deletions

View File

@@ -167,6 +167,12 @@ export class UserMediaTileViewModel extends BaseTileViewModel {
*/
public readonly videoEnabled: StateObservable<boolean>;
private readonly _cropVideo = new BehaviorSubject(true);
/**
* Whether the tile video should be contained inside the tile or be cropped to fit.
*/
public readonly cropVideo = state(this._cropVideo);
public constructor(
id: string,
member: RoomMember | undefined,
@@ -205,6 +211,10 @@ export class UserMediaTileViewModel extends BaseTileViewModel {
this._locallyMuted.next(!this._locallyMuted.value);
}
public toggleFitContain(): void {
this._cropVideo.next(!this._cropVideo.value);
}
public setLocalVolume(value: number): void {
this._localVolume.next(value);
}