Skip to content

Commit

Permalink
openvidu-testapp: make deviceId a proper selector in VideoCaptureOptions
Browse files Browse the repository at this point in the history
  • Loading branch information
pabloFuente committed Oct 28, 2024
1 parent ed2fa45 commit 1d91d6f
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,11 @@ <h2 mat-dialog-title>OPTIONS</h2>
<mat-radio-button [value]="'custom'" id="video-capture-custom">Custom</mat-radio-button>
</mat-radio-group>
<div *ngIf="videoOption === 'custom'">
<mat-form-field class="inner-text-input">
<mat-form-field id="video-deviceId">
<mat-label>deviceId</mat-label>
<input matInput id="video-deviceId" placeholder="deviceId" [(ngModel)]="auxVideoCaptureOptions.deviceId"/>
<mat-select [(value)]="auxVideoCaptureOptions.deviceId">
<mat-option *ngFor="let device of inputVideoDevices" [value]="{ exact: device.deviceId }">{{'[' + device.label + '] ' + device.deviceId}}</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field id="video-facingMode">
<mat-label>facingMode</mat-label>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ export class OptionsDialogComponent {

ENUMERATION_SOURCE = Object.keys(Track.Source);

inputVideoDevices: MediaDeviceInfo[] = [];

constructor(
public dialogRef: MatDialogRef<OptionsDialogComponent>,
@Inject(MAT_DIALOG_DATA)
Expand Down Expand Up @@ -98,6 +100,9 @@ export class OptionsDialogComponent {
if (this.data.allowDisablingScreen === false) {
this.allowDisablingScreen = false;
}
Room.getLocalDevices('videoinput').then((devices) => {
this.inputVideoDevices = devices;
});
}

returnValues() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ export class VideoTrackComponent extends TrackComponent {

toggleVideoZoom() {
this.videoZoom = !this.videoZoom;
let newWidth = this.videoZoom ? '720px' : '120px';
let newWidth = this.videoZoom ? '1500px' : '120px';
this.elementRef.nativeElement.style.width = newWidth;
}
}

0 comments on commit 1d91d6f

Please sign in to comment.