Skip to content

Commit

Permalink
openvidu-testapp: toggle video zoom
Browse files Browse the repository at this point in the history
  • Loading branch information
pabloFuente committed Oct 24, 2024
1 parent 897404b commit 57d9287
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,10 @@ export class RoomApiDialogComponent {
this.localParticipant = data.localParticipant;
this.apiRoomName = this.room?.name;
this.apiParticipantIdentity = this.localParticipant?.identity;
this.apiTrackSid = this.localParticipant?.videoTrackPublications.values().next().value?.trackSid;
this.apiTrackSid = this.localParticipant?.videoTrackPublications.values().next().value?.trackSid!;
this.egressRoomName = this.room?.name;
this.audioTrackId = this.localParticipant?.audioTrackPublications.values().next().value?.trackSid;
this.videoTrackId = this.localParticipant?.videoTrackPublications.values().next().value?.trackSid;
this.audioTrackId = this.localParticipant?.audioTrackPublications.values().next().value?.trackSid!;
this.videoTrackId = this.localParticipant?.videoTrackPublications.values().next().value?.trackSid!;
this.ingressRoomName = this.room?.name;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import {
LocalTrack,
RemoteTrack,
TrackEventCallbacks,
LocalTrackPublication,
RemoteTrackPublication,
AudioTrack,
VideoTrack,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
video {
height: 90px;
width: 120px;
}

Expand All @@ -18,6 +17,12 @@ video {
bottom: 0;
}

.top-right-div {
position: absolute;
top: 0;
right: 0;
}

.video-btn {
border: none;
background: rgba(255, 255, 255, 0.75);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,11 @@
aria-hidden="true">{{blurIcon}}</mat-icon>
</button>-->
</div>
<div class="top-right-div">
<button *ngIf="!localParticipant" (click)="toggleVideoZoom()" class="video-btn toggle-video-zoom" matTooltip="Toggle video zoom"
matTooltipClass="custom-tooltip">
<mat-icon aria-label="Toggle video zoom" class="mat-icon material-icons" role="img"
aria-hidden="true">{{videoZoom ? 'zoom_out' : 'zoom_in'}}</mat-icon>
</button>
</div>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ export class VideoTrackComponent extends TrackComponent {
blurIcon: string = 'blur_on';
maxVideoQuality: string;

videoZoom = false;

constructor(
protected override testFeedService: TestFeedService,
private dialog: MatDialog
Expand Down Expand Up @@ -96,4 +98,10 @@ export class VideoTrackComponent extends TrackComponent {
this.blurIcon = 'blur_on';
}
}

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

0 comments on commit 57d9287

Please sign in to comment.