frontend: remove unused token request handler and integrate recording service

This commit is contained in:
Carlos Santos 2025-07-21 17:14:56 +02:00
parent 7431c90238
commit 0dae7ff81d
2 changed files with 14 additions and 9 deletions

View File

@ -136,7 +136,6 @@
}"
[activitiesPanelBroadcastingActivity]="false"
[showDisconnectionDialog]="false"
(onTokenRequested)="onTokenRequested()"
(onRoomCreated)="onRoomCreated($event)"
(onParticipantConnected)="onParticipantConnected($event)"
(onParticipantLeft)="onParticipantLeft($event)"

View File

@ -107,7 +107,8 @@ export class VideoRoomComponent implements OnInit {
protected sessionStorageService: SessionStorageService,
protected featureConfService: FeatureConfigurationService,
protected clipboard: Clipboard,
protected notificationService: NotificationService
protected notificationService: NotificationService,
protected recordingService: RecordingManagerService
) {
this.features = this.featureConfService.features;
}
@ -243,13 +244,13 @@ export class VideoRoomComponent implements OnInit {
*/
private async generateParticipantToken() {
try {
const { /*token,*/ role } = await this.participantTokenService.generateToken({
const { token, role } = await this.participantTokenService.generateToken({
roomId: this.roomId,
participantName: this.participantName,
secret: this.roomSecret
});
// The components library needs the token to be set in the 'onTokenRequested' method
// this.participantToken = token;
this.participantToken = token;
this.participantRole = role;
} catch (error: any) {
console.error('Error generating participant token:', error);
@ -297,11 +298,6 @@ export class VideoRoomComponent implements OnInit {
});
}
onTokenRequested() {
// Participant token must be set only when requested
this.participantToken = this.participantTokenService.getParticipantToken() || '';
}
onRoomCreated(room: Room) {
room.on(
RoomEvent.DataReceived,
@ -352,6 +348,16 @@ export class VideoRoomComponent implements OnInit {
await this.navigationService.navigateTo('disconnected', { reason: leftReason });
}
async onViewRecordingsClicked(recordingId?: any) {
if (recordingId) {
const privateAccess = true;
const { url } = await this.recordingService.generateRecordingUrl(recordingId, privateAccess);
window.open(url, '_blank');
} else {
window.open(`/room/${this.roomId}/recordings`, '_blank');
}
}
/**
* Maps ParticipantLeftReason to LeftEventReason.
* This method translates the technical reasons for a participant leaving the room