frontend: enhance VideoRoomComponent to fetch room details on initialization and notify user when copying links

This commit is contained in:
juancarmore 2025-07-07 17:52:14 +02:00
parent 709ebdef03
commit f58d728452

View File

@ -17,6 +17,7 @@ import {
AuthService, AuthService,
FeatureConfigurationService, FeatureConfigurationService,
NavigationService, NavigationService,
NotificationService,
ParticipantTokenService, ParticipantTokenService,
RecordingManagerService, RecordingManagerService,
RoomService, RoomService,
@ -24,6 +25,7 @@ import {
WebComponentManagerService WebComponentManagerService
} from '@lib/services'; } from '@lib/services';
import { import {
MeetRoom,
MeetRoomPreferences, MeetRoomPreferences,
ParticipantRole, ParticipantRole,
WebComponentEvent, WebComponentEvent,
@ -74,6 +76,8 @@ export class VideoRoomComponent implements OnInit, OnDestroy {
}); });
showRoom = false; showRoom = false;
showRecordingCard = false; showRecordingCard = false;
room?: MeetRoom;
roomId = ''; roomId = '';
roomSecret = ''; roomSecret = '';
participantName = ''; participantName = '';
@ -94,7 +98,8 @@ export class VideoRoomComponent implements OnInit, OnDestroy {
protected wcManagerService: WebComponentManagerService, protected wcManagerService: WebComponentManagerService,
protected sessionStorageService: SessionStorageService, protected sessionStorageService: SessionStorageService,
protected featureConfService: FeatureConfigurationService, protected featureConfService: FeatureConfigurationService,
protected clipboard: Clipboard protected clipboard: Clipboard,
protected notificationService: NotificationService
) { ) {
this.features = this.featureConfService.features; this.features = this.featureConfService.features;
} }
@ -102,6 +107,7 @@ export class VideoRoomComponent implements OnInit, OnDestroy {
async ngOnInit() { async ngOnInit() {
this.roomId = this.roomService.getRoomId(); this.roomId = this.roomService.getRoomId();
this.roomSecret = this.roomService.getRoomSecret(); this.roomSecret = this.roomService.getRoomSecret();
this.room = await this.roomService.getRoom(this.roomId);
await this.checkForRecordings(); await this.checkForRecordings();
await this.initializeParticipantName(); await this.initializeParticipantName();
@ -169,16 +175,14 @@ export class VideoRoomComponent implements OnInit, OnDestroy {
await this.roomService.kickParticipant(this.roomId, participant.identity); await this.roomService.kickParticipant(this.roomId, participant.identity);
} }
// TODO: Improve this method for avoiding rest requests
async copyModeratorLink() { async copyModeratorLink() {
const room = await this.roomService.getRoom(this.roomId); this.clipboard.copy(this.room!.moderatorRoomUrl);
this.clipboard.copy(room.moderatorRoomUrl); this.notificationService.showSnackbar('Moderator link copied to clipboard');
} }
// TODO: Improve this method for avoiding rest requests
async copyPublisherLink() { async copyPublisherLink() {
const room = await this.roomService.getRoom(this.roomId); this.clipboard.copy(this.room!.publisherRoomUrl);
this.clipboard.copy(room.publisherRoomUrl); this.notificationService.showSnackbar('Publisher link copied to clipboard');
} }
/** /**