frontend: remove unused token request handler and integrate recording service
This commit is contained in:
parent
7431c90238
commit
0dae7ff81d
@ -136,7 +136,6 @@
|
|||||||
}"
|
}"
|
||||||
[activitiesPanelBroadcastingActivity]="false"
|
[activitiesPanelBroadcastingActivity]="false"
|
||||||
[showDisconnectionDialog]="false"
|
[showDisconnectionDialog]="false"
|
||||||
(onTokenRequested)="onTokenRequested()"
|
|
||||||
(onRoomCreated)="onRoomCreated($event)"
|
(onRoomCreated)="onRoomCreated($event)"
|
||||||
(onParticipantConnected)="onParticipantConnected($event)"
|
(onParticipantConnected)="onParticipantConnected($event)"
|
||||||
(onParticipantLeft)="onParticipantLeft($event)"
|
(onParticipantLeft)="onParticipantLeft($event)"
|
||||||
|
|||||||
@ -107,7 +107,8 @@ export class VideoRoomComponent implements OnInit {
|
|||||||
protected sessionStorageService: SessionStorageService,
|
protected sessionStorageService: SessionStorageService,
|
||||||
protected featureConfService: FeatureConfigurationService,
|
protected featureConfService: FeatureConfigurationService,
|
||||||
protected clipboard: Clipboard,
|
protected clipboard: Clipboard,
|
||||||
protected notificationService: NotificationService
|
protected notificationService: NotificationService,
|
||||||
|
protected recordingService: RecordingManagerService
|
||||||
) {
|
) {
|
||||||
this.features = this.featureConfService.features;
|
this.features = this.featureConfService.features;
|
||||||
}
|
}
|
||||||
@ -243,13 +244,13 @@ export class VideoRoomComponent implements OnInit {
|
|||||||
*/
|
*/
|
||||||
private async generateParticipantToken() {
|
private async generateParticipantToken() {
|
||||||
try {
|
try {
|
||||||
const { /*token,*/ role } = await this.participantTokenService.generateToken({
|
const { token, role } = await this.participantTokenService.generateToken({
|
||||||
roomId: this.roomId,
|
roomId: this.roomId,
|
||||||
participantName: this.participantName,
|
participantName: this.participantName,
|
||||||
secret: this.roomSecret
|
secret: this.roomSecret
|
||||||
});
|
});
|
||||||
// The components library needs the token to be set in the 'onTokenRequested' method
|
// The components library needs the token to be set in the 'onTokenRequested' method
|
||||||
// this.participantToken = token;
|
this.participantToken = token;
|
||||||
this.participantRole = role;
|
this.participantRole = role;
|
||||||
} catch (error: any) {
|
} catch (error: any) {
|
||||||
console.error('Error generating participant token:', error);
|
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) {
|
onRoomCreated(room: Room) {
|
||||||
room.on(
|
room.on(
|
||||||
RoomEvent.DataReceived,
|
RoomEvent.DataReceived,
|
||||||
@ -352,6 +348,16 @@ export class VideoRoomComponent implements OnInit {
|
|||||||
await this.navigationService.navigateTo('disconnected', { reason: leftReason });
|
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.
|
* Maps ParticipantLeftReason to LeftEventReason.
|
||||||
* This method translates the technical reasons for a participant leaving the room
|
* This method translates the technical reasons for a participant leaving the room
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user